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. 6
      consensus/consensus_v2.go

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

Loading…
Cancel
Save