revert verify block

pull/3405/head
Rongjian Lan 4 years ago
parent 28487fa38b
commit 2be83cede7
  1. 20
      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().

Loading…
Cancel
Save