Skip to content

Commit 75c715b

Browse files
committed
Removed lock acquiring for the method BlockCommitSigs.
1 parent 3a2349c commit 75c715b

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
@@ -276,11 +276,10 @@ func (consensus *Consensus) BlockCommitSigs(blockNum uint64) ([]byte, error) {
276276
return nil, nil
277277
}
278278
lastCommits, err := consensus.Blockchain().ReadCommitSig(blockNum)
279-
consensus.mutex.Lock()
280-
defer consensus.mutex.Unlock()
281-
if err != nil ||
282-
len(lastCommits) < bls.BLSSignatureSizeInBytes {
283-
msgs := consensus.FBFTLog().GetMessagesByTypeSeq(
279+
if err != nil || len(lastCommits) < bls.BLSSignatureSizeInBytes {
280+
consensus.mutex.Lock()
281+
defer consensus.mutex.Unlock()
282+
msgs := consensus.fBFTLog.GetMessagesByTypeSeq(
284283
msg_pb.MessageType_COMMITTED, blockNum,
285284
)
286285
if len(msgs) != 1 {

0 commit comments

Comments
 (0)