Removed multiSigMutex locks.

pull/4369/head
frozen 2 years ago committed by Casey Gardiner
parent ce18c59d4b
commit e4ba190e63
  1. 1
      consensus/consensus.go
  2. 3
      consensus/consensus_service.go
  3. 2
      consensus/fbft_log.go

@ -61,7 +61,6 @@ type Consensus struct {
commitBitmap *bls_cosi.Mask commitBitmap *bls_cosi.Mask
multiSigBitmap *bls_cosi.Mask // Bitmap for parsing multisig bitmap from validators multiSigBitmap *bls_cosi.Mask // Bitmap for parsing multisig bitmap from validators
multiSigMutex sync.RWMutex
// Registry for services. // Registry for services.
registry *registry.Registry registry *registry.Registry

@ -138,9 +138,8 @@ func (consensus *Consensus) UpdateBitmaps() {
multiSigBitmap, _ := bls_cosi.NewMask(members, nil) multiSigBitmap, _ := bls_cosi.NewMask(members, nil)
consensus.prepareBitmap = prepareBitmap consensus.prepareBitmap = prepareBitmap
consensus.commitBitmap = commitBitmap consensus.commitBitmap = commitBitmap
consensus.multiSigMutex.Lock()
consensus.multiSigBitmap = multiSigBitmap consensus.multiSigBitmap = multiSigBitmap
consensus.multiSigMutex.Unlock()
} }
// ResetState resets the state of the consensus // ResetState resets the state of the consensus

@ -360,9 +360,7 @@ func (consensus *Consensus) ParseFBFTMessage(msg *msg_pb.Message) (*FBFTMessage,
copy(pbftMsg.SenderPubkeys[0].Bytes[:], consensusMsg.SenderPubkey[:]) copy(pbftMsg.SenderPubkeys[0].Bytes[:], consensusMsg.SenderPubkey[:])
} else { } else {
// else, it should be a multi-key message where the bitmap is populated // else, it should be a multi-key message where the bitmap is populated
consensus.multiSigMutex.RLock()
pubKeys, err := consensus.multiSigBitmap.GetSignedPubKeysFromBitmap(pbftMsg.SenderPubkeyBitmap) pubKeys, err := consensus.multiSigBitmap.GetSignedPubKeysFromBitmap(pbftMsg.SenderPubkeyBitmap)
consensus.multiSigMutex.RUnlock()
if err != nil { if err != nil {
return nil, err return nil, err
} }

Loading…
Cancel
Save