Skip to content

Commit

Permalink
Removed lock acquiring for the method BlockCommitSigs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frozen committed Oct 14, 2024
1 parent 2e824e1 commit 616cdad
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions consensus/consensus_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,10 @@ func (consensus *Consensus) BlockCommitSigs(blockNum uint64) ([]byte, error) {
return nil, nil
}
lastCommits, err := consensus.Blockchain().ReadCommitSig(blockNum)
consensus.mutex.Lock()
defer consensus.mutex.Unlock()
if err != nil ||
len(lastCommits) < bls.BLSSignatureSizeInBytes {
msgs := consensus.FBFTLog().GetMessagesByTypeSeq(
if err != nil || len(lastCommits) < bls.BLSSignatureSizeInBytes {
consensus.mutex.Lock()
defer consensus.mutex.Unlock()
msgs := consensus.fBFTLog.GetMessagesByTypeSeq(
msg_pb.MessageType_COMMITTED, blockNum,
)
if len(msgs) != 1 {
Expand Down

0 comments on commit 616cdad

Please sign in to comment.