diff options
| author | Paul Buetow <paul@buetow.org> | 2023-05-28 21:27:56 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-05-28 21:27:56 +0300 |
| commit | 2d04a386f6e06b2742188f8f05ef0199c3a366cf (patch) | |
| tree | c4f36c824ece7a3f7599caab72f53d22db8da886 | |
| parent | d0d7460ab74d7467a8c2bcc7d8c384cb0196b807 (diff) | |
skip expired votes
| -rw-r--r-- | internal/quorum/quorum.go | 3 |
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 |
