diff options
Diffstat (limited to 'core/consensus.go')
-rw-r--r-- | core/consensus.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/core/consensus.go b/core/consensus.go index bf3650f..f9b8b37 100644 --- a/core/consensus.go +++ b/core/consensus.go @@ -783,20 +783,15 @@ func (con *Consensus) ProcessBlockRandomnessResult( if !con.ccModule.blockRegistered(rand.BlockHash) { return nil } - // TODO(jimmy-dexon): reuse the GPK. round := rand.Position.Round - con.logger.Debug("Calling Governance.DKGMasterPublicKeys", - "round", con.round) - con.logger.Debug("Calling Governance.DKGComplaints", "round", con.round) - con.logger.Debug("Calling Governance.Configuration", "round", con.round) - gpk, err := NewDKGGroupPublicKey(round, - con.gov.DKGMasterPublicKeys(round), - con.gov.DKGComplaints(round), - int(con.gov.Configuration(round).DKGSetSize/3)+1) + v, ok, err := con.ccModule.tsigVerifier.UpdateAndGet(round) if err != nil { return err } - if !gpk.VerifySignature( + if !ok { + return nil + } + if !v.VerifySignature( rand.BlockHash, crypto.Signature{Signature: rand.Randomness}) { return ErrIncorrectBlockRandomnessResult } |