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 Aug 12, 2024
1 parent 051e244 commit 200d508
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 @@ -277,11 +277,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 200d508

Please sign in to comment.