Skip to content

Commit 200d508

Browse files
committed
Removed lock acquiring for the method BlockCommitSigs.
1 parent 051e244 commit 200d508

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

consensus/consensus_v2.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,10 @@ func (consensus *Consensus) BlockCommitSigs(blockNum uint64) ([]byte, error) {
277277
return nil, nil
278278
}
279279
lastCommits, err := consensus.Blockchain().ReadCommitSig(blockNum)
280-
consensus.mutex.Lock()
281-
defer consensus.mutex.Unlock()
282-
if err != nil ||
283-
len(lastCommits) < bls.BLSSignatureSizeInBytes {
284-
msgs := consensus.FBFTLog().GetMessagesByTypeSeq(
280+
if err != nil || len(lastCommits) < bls.BLSSignatureSizeInBytes {
281+
consensus.mutex.Lock()
282+
defer consensus.mutex.Unlock()
283+
msgs := consensus.fBFTLog.GetMessagesByTypeSeq(
285284
msg_pb.MessageType_COMMITTED, blockNum,
286285
)
287286
if len(msgs) != 1 {

0 commit comments

Comments
 (0)