From 2be83cede7026798db2a45aeab2dd8e73642d106 Mon Sep 17 00:00:00 2001 From: Rongjian Lan Date: Thu, 5 Nov 2020 12:31:21 -0800 Subject: [PATCH] revert verify block --- consensus/validator.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/consensus/validator.go b/consensus/validator.go index a692d3969..e1615541f 100644 --- a/consensus/validator.go +++ b/consensus/validator.go @@ -155,16 +155,6 @@ func (consensus *Consensus) onPrepared(msg *msg_pb.Message) { consensus.mutex.Lock() defer consensus.mutex.Unlock() - if consensus.BlockVerifier == nil { - consensus.getLogger().Debug().Msg("[onPrepared] consensus received message before init. Ignoring") - return - } - if err := consensus.BlockVerifier(&blockObj); err != nil { - consensus.getLogger().Error().Err(err).Msg("[OnPrepared] Block verification failed") - return - } - consensus.FBFTLog.MarkBlockVerified(&blockObj) - consensus.FBFTLog.AddBlock(&blockObj) // add block field blockPayload := make([]byte, len(recvMsg.Block)) @@ -178,6 +168,16 @@ func (consensus *Consensus) onPrepared(msg *msg_pb.Message) { Hex("blockHash", recvMsg.BlockHash[:]). Msg("[OnPrepared] Prepared message and block added") + if consensus.BlockVerifier == nil { + consensus.getLogger().Debug().Msg("[onPrepared] consensus received message before init. Ignoring") + return + } + if err := consensus.BlockVerifier(&blockObj); err != nil { + consensus.getLogger().Error().Err(err).Msg("[OnPrepared] Block verification failed") + return + } + consensus.FBFTLog.MarkBlockVerified(&blockObj) + if consensus.checkViewID(recvMsg) != nil { if consensus.current.Mode() == Normal { consensus.getLogger().Debug().