aboutsummaryrefslogtreecommitdiffstats
path: root/core/utils.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-05-02 20:35:18 +0800
committerJimmy Hu <jimmy.hu@dexon.org>2019-05-02 21:04:23 +0800
commit1edd55a2ff91bbbe94b8c1e8564ea2e5a45cf37c (patch)
treee005aadd788f93806335669aa720b83cf4d84038 /core/utils.go
parent86befa5015417359f7b569cff9d6c3f02045f394 (diff)
downloaddexon-consensus-1edd55a2ff91bbbe94b8c1e8564ea2e5a45cf37c.tar.gz
dexon-consensus-1edd55a2ff91bbbe94b8c1e8564ea2e5a45cf37c.tar.zst
dexon-consensus-1edd55a2ff91bbbe94b8c1e8564ea2e5a45cf37c.zip
core: optimize syncer handling agreement resulttestnet
Diffstat (limited to 'core/utils.go')
-rw-r--r--core/utils.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/utils.go b/core/utils.go
index c9d5f84..c4d7b0f 100644
--- a/core/utils.go
+++ b/core/utils.go
@@ -158,13 +158,17 @@ func HashConfigurationBlock(
// VerifyAgreementResult perform sanity check against a types.AgreementResult
// instance.
func VerifyAgreementResult(
- res *types.AgreementResult, notarySet map[types.NodeID]struct{}) error {
+ res *types.AgreementResult, cache *NodeSetCache) error {
if res.Position.Round >= DKGDelayRound {
if len(res.Randomness) == 0 {
return ErrMissingRandomness
}
return nil
}
+ notarySet, err := cache.GetNotarySet(res.Position.Round)
+ if err != nil {
+ return err
+ }
if len(res.Votes) < len(notarySet)*2/3+1 {
return ErrNotEnoughVotes
}