make sig verification in the same thread (#3537)

pull/3539/head
Rongjian Lan 4 years ago committed by GitHub
parent 6ee2e5d143
commit 0a717a858f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      consensus/consensus_v2.go

@ -555,17 +555,17 @@ func (consensus *Consensus) preCommitAndPropose(blk *types.Block) error {
return err
}
msgToSend, FBFTMsg :=
network.Bytes,
network.FBFTMsg
bareMinimumCommit := FBFTMsg.Payload
consensus.FBFTLog.AddVerifiedMessage(FBFTMsg)
if err := consensus.verifyLastCommitSig(bareMinimumCommit, blk); err != nil {
return errors.Wrap(err, "[preCommitAndPropose] failed verifying last commit sig")
}
go func() {
msgToSend, FBFTMsg :=
network.Bytes,
network.FBFTMsg
bareMinimumCommit := FBFTMsg.Payload
consensus.FBFTLog.AddVerifiedMessage(FBFTMsg)
if err := consensus.verifyLastCommitSig(bareMinimumCommit, blk); err != nil {
consensus.getLogger().Warn().Err(err).Msg("[preCommitAndPropose] failed verifying last commit sig")
return
}
blk.SetCurrentCommitSig(bareMinimumCommit)
if _, err := consensus.Blockchain.InsertChain([]*types.Block{blk}, true); err != nil {

Loading…
Cancel
Save