Skip to content

Commit 616cdad

Browse files
committed
Removed lock acquiring for the method BlockCommitSigs.
1 parent 2e824e1 commit 616cdad

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
@@ -301,11 +301,10 @@ func (consensus *Consensus) BlockCommitSigs(blockNum uint64) ([]byte, error) {
301301
return nil, nil
302302
}
303303
lastCommits, err := consensus.Blockchain().ReadCommitSig(blockNum)
304-
consensus.mutex.Lock()
305-
defer consensus.mutex.Unlock()
306-
if err != nil ||
307-
len(lastCommits) < bls.BLSSignatureSizeInBytes {
308-
msgs := consensus.FBFTLog().GetMessagesByTypeSeq(
304+
if err != nil || len(lastCommits) < bls.BLSSignatureSizeInBytes {
305+
consensus.mutex.Lock()
306+
defer consensus.mutex.Unlock()
307+
msgs := consensus.fBFTLog.GetMessagesByTypeSeq(
309308
msg_pb.MessageType_COMMITTED, blockNum,
310309
)
311310
if len(msgs) != 1 {

0 commit comments

Comments
 (0)