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 Sep 5, 2024
1 parent 3a2349c commit 75c715b
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 @@ -276,11 +276,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 75c715b

Please sign in to comment.