|
|
|
@ -588,7 +588,7 @@ func (consensus *Consensus) preCommitAndPropose(blk *types.Block) error { |
|
|
|
|
go func() { |
|
|
|
|
blk.SetCurrentCommitSig(bareMinimumCommit) |
|
|
|
|
|
|
|
|
|
if _, err := consensus.Blockchain.InsertChain([]*types.Block{blk}, true); err != nil { |
|
|
|
|
if _, err := consensus.Blockchain.InsertChain([]*types.Block{blk}, !consensus.FBFTLog.IsBlockVerified(blk)); err != nil { |
|
|
|
|
consensus.getLogger().Error().Err(err).Msg("[preCommitAndPropose] Failed to add block to chain") |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
@ -690,7 +690,8 @@ func (consensus *Consensus) tryCatchup() error { |
|
|
|
|
|
|
|
|
|
func (consensus *Consensus) commitBlock(blk *types.Block, committedMsg *FBFTMessage) error { |
|
|
|
|
if consensus.Blockchain.CurrentBlock().NumberU64() < blk.NumberU64() { |
|
|
|
|
if _, err := consensus.Blockchain.InsertChain([]*types.Block{blk}, true); err != nil { |
|
|
|
|
consensus.FBFTLog.IsBlockVerified(blk) |
|
|
|
|
if _, err := consensus.Blockchain.InsertChain([]*types.Block{blk}, !consensus.FBFTLog.IsBlockVerified(blk)); err != nil { |
|
|
|
|
consensus.getLogger().Error().Err(err).Msg("[commitBlock] Failed to add block to chain") |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|