|
|
|
@ -84,7 +84,7 @@ func (consensus *Consensus) validateNewBlock(recvMsg *FBFTMessage) (*types.Block |
|
|
|
|
|
|
|
|
|
blockObj = consensus.FBFTLog.GetBlockByHash(recvMsg.BlockHash) |
|
|
|
|
if blockObj == nil { |
|
|
|
|
if err := rlp.DecodeBytes(recvMsg.Block, &blockObj); err != nil { |
|
|
|
|
if err := rlp.DecodeBytes(recvMsg.Block, blockObj); err != nil { |
|
|
|
|
consensus.getLogger().Warn(). |
|
|
|
|
Err(err). |
|
|
|
|
Uint64("MsgBlockNum", recvMsg.BlockNum). |
|
|
|
@ -157,7 +157,7 @@ func (consensus *Consensus) prepare() { |
|
|
|
|
|
|
|
|
|
// sendCommitMessages send out commit messages to leader
|
|
|
|
|
func (consensus *Consensus) sendCommitMessages(blockObj *types.Block) { |
|
|
|
|
if consensus.IsBackup() { |
|
|
|
|
if consensus.IsBackup() || blockObj == nil { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -269,6 +269,9 @@ func (consensus *Consensus) onPrepared(recvMsg *FBFTMessage) { |
|
|
|
|
|
|
|
|
|
go func() { |
|
|
|
|
// Try process future committed messages and process them in case of receiving committed before prepared
|
|
|
|
|
if blockObj == nil { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
curBlockNum := consensus.blockNum |
|
|
|
|
for _, committedMsg := range consensus.FBFTLog.GetNotVerifiedCommittedMessages(blockObj.NumberU64(), blockObj.Header().ViewID().Uint64(), blockObj.Hash()) { |
|
|
|
|
if committedMsg != nil { |
|
|
|
|