diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-05-02 21:07:49 +0800 |
---|---|---|
committer | Jimmy Hu <jimmy.hu@dexon.org> | 2019-05-02 21:35:46 +0800 |
commit | c361083f3f04c2a4e9b50bd2f8fb963e2985ab1d (patch) | |
tree | 40b129b57bc7cd3de8659238550d369afe64a5ad /vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go | |
parent | 528b0252cdf359b5c3bd0dd22c96641c06eb5659 (diff) | |
download | dexon-testnet.tar dexon-testnet.tar.gz dexon-testnet.tar.bz2 dexon-testnet.tar.lz dexon-testnet.tar.xz dexon-testnet.tar.zst dexon-testnet.zip |
vendor: sync to latest coretestnet
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go index 966c70aaa..b5baace86 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go @@ -93,13 +93,23 @@ func (recv *consensusBAReceiver) VerifyPartialSignature(vote *types.Vote) bool { if vote.Position.Round >= DKGDelayRound && vote.BlockHash != types.SkipBlockHash { if vote.Type == types.VoteCom || vote.Type == types.VoteFastCom { if recv.npks == nil { + recv.consensus.logger.Debug( + "Unable to verify psig, npks is nil", + "vote", vote) return false } if vote.Position.Round != recv.npks.Round { + recv.consensus.logger.Debug( + "Unable to verify psig, round of npks mismatch", + "vote", vote, + "npksRound", recv.npks.Round) return false } pubKey, exist := recv.npks.PublicKeys[vote.ProposerID] if !exist { + recv.consensus.logger.Debug( + "Unable to verify psig, proposer is not qualified", + "vote", vote) return false } blockHash := vote.BlockHash @@ -1114,6 +1124,10 @@ func (con *Consensus) generateBlockRandomness(blocks []*types.Block) { "block", block, "result", result) con.network.BroadcastAgreementResult(result) + if err := con.deliverFinalizedBlocks(); err != nil { + con.logger.Error("Failed to deliver finalized block", + "error", err) + } } }(block) } @@ -1354,11 +1368,7 @@ func (con *Consensus) ProcessAgreementResult( return nil } // Sanity Check. - notarySet, err := con.nodeSetCache.GetNotarySet(rand.Position.Round) - if err != nil { - return err - } - if err := VerifyAgreementResult(rand, notarySet); err != nil { + if err := VerifyAgreementResult(rand, con.nodeSetCache); err != nil { con.baMgr.untouchAgreementResult(rand) return err } |