summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-05-28 21:27:56 +0300
committerPaul Buetow <paul@buetow.org>2023-05-28 21:27:56 +0300
commit2d04a386f6e06b2742188f8f05ef0199c3a366cf (patch)
treec4f36c824ece7a3f7599caab72f53d22db8da886
parentd0d7460ab74d7467a8c2bcc7d8c384cb0196b807 (diff)
skip expired votes
-rw-r--r--internal/quorum/quorum.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/quorum/quorum.go b/internal/quorum/quorum.go
index 6c4bcb6..01c861a 100644
--- a/internal/quorum/quorum.go
+++ b/internal/quorum/quorum.go
@@ -91,6 +91,9 @@ func (quo Quorum) score() (scores []Score) {
scoreMap := make(map[string]int)
for _, vote := range quo.votes {
+ if vote.Expired() {
+ continue
+ }
for _, id := range vote.IDs {
score, _ := scoreMap[id]
scoreMap[id] = score + 1