diff options
Diffstat (limited to 'core/syncer/agreement.go')
-rw-r--r-- | core/syncer/agreement.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/syncer/agreement.go b/core/syncer/agreement.go index d39c246..b414e11 100644 --- a/core/syncer/agreement.go +++ b/core/syncer/agreement.go @@ -176,7 +176,12 @@ func (a *agreement) processAgreementResult(r *types.AgreementResult) { a.logger.Trace("Agreement result cached", "result", r) return } - if err := core.VerifyAgreementResult(r, a.cache); err != nil { + notarySet, err := a.cache.GetNotarySet(r.Position.Round) + if err != nil { + a.logger.Error("unable to get notary set", "result", r, "error", err) + return + } + if err := core.VerifyAgreementResult(r, notarySet); err != nil { a.logger.Error("Agreement result verification failed", "result", r, "error", err) @@ -252,13 +257,18 @@ func (a *agreement) processNewCRS(round uint64) { a.latestCRSRound = round // Verify all pending results. for r := prevRound; r <= a.latestCRSRound; r++ { + notarySet, err := a.cache.GetNotarySet(r) + if err != nil { + a.logger.Error("Unable to get notary set", "round", r, "error", err) + continue + } pendingsForRound := a.pendingAgrs[r] if pendingsForRound == nil { continue } delete(a.pendingAgrs, r) for _, res := range pendingsForRound { - if err := core.VerifyAgreementResult(res, a.cache); err != nil { + if err := core.VerifyAgreementResult(res, notarySet); err != nil { a.logger.Error("Invalid agreement result", "result", res, "error", err) |