aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/dexon-foundation/dexon-consensus/core/utils/vote-filter.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/utils/vote-filter.go')
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/utils/vote-filter.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/utils/vote-filter.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/utils/vote-filter.go
index 2fc18bb34..446d88a64 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/utils/vote-filter.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/utils/vote-filter.go
@@ -25,7 +25,7 @@ import (
// To maximize performance, this structure is not thread-safe and will never be.
type VoteFilter struct {
Voted map[types.VoteHeader]struct{}
- Height uint64
+ Position types.Position
LockIter uint64
Period uint64
Confirm bool
@@ -43,9 +43,9 @@ func (vf *VoteFilter) Filter(vote *types.Vote) bool {
if vote.Type == types.VoteInit {
return true
}
- if vote.Position.Height < vf.Height {
+ if vote.Position.Older(vf.Position) {
return true
- } else if vote.Position.Height > vf.Height {
+ } else if vote.Position.Newer(vf.Position) {
// It's impossible to check the vote of other height.
return false
}