Skip to content

Commit

Permalink
simplifiy check for multi bls key
Browse files Browse the repository at this point in the history
  • Loading branch information
GheisMohammadi committed Nov 14, 2024
1 parent 5d17bfb commit 3b6fde4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions consensus/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,8 @@ func (consensus *Consensus) onCommit(recvMsg *FBFTMessage) {
// check if it is first received commit
// it may multi bls key validators can achieve quorum on first commit
isFirstReceivedSignature := false
lenPrvKeys := len(consensus.priKey)
hasMultiBlsKey := lenPrvKeys > 0
if hasMultiBlsKey {
hasMultiBlsKeys := len(consensus.priKey) > 0
if hasMultiBlsKeys {
var myPubkeys []bls.SerializedPublicKey
for _, key := range consensus.priKey {
myPubkeys = append(myPubkeys, key.Pub.Bytes)
Expand Down Expand Up @@ -305,7 +304,7 @@ func (consensus *Consensus) onCommit(recvMsg *FBFTMessage) {
quorumIsMet := consensus.decider.IsQuorumAchieved(quorum.Commit)
//// Read - End

quorumAchievedByFirstCommit := hasMultiBlsKey && isFirstReceivedSignature && quorumWasMet
quorumAchievedByFirstCommit := hasMultiBlsKeys && isFirstReceivedSignature && quorumWasMet
quorumAchievedByThisCommit := !quorumWasMet && quorumIsMet

if quorumAchievedByFirstCommit || quorumAchievedByThisCommit {
Expand Down

0 comments on commit 3b6fde4

Please sign in to comment.