diff --git a/consensus/quorum/one-node-staked-vote.go b/consensus/quorum/one-node-staked-vote.go index e18b99f99..018e50b87 100644 --- a/consensus/quorum/one-node-staked-vote.go +++ b/consensus/quorum/one-node-staked-vote.go @@ -146,6 +146,9 @@ func (v *stakedVoteWeight) IsQuorumAchieved(p Phase) bool { // IsQuorumAchivedByMask .. func (v *stakedVoteWeight) IsQuorumAchievedByMask(mask *bls_cosi.Mask) bool { threshold := v.QuorumThreshold() + if mask == nil { + return false + } currentTotalPower := v.computeTotalPowerByMask(mask) if currentTotalPower == nil { return false diff --git a/consensus/view_change.go b/consensus/view_change.go index a3864cee4..164c4d99b 100644 --- a/consensus/view_change.go +++ b/consensus/view_change.go @@ -351,7 +351,7 @@ func (consensus *Consensus) onViewChange(msg *msg_pb.Message) { return } - if consensus.Decider.IsQuorumAchieved(quorum.ViewChange) { + if consensus.Decider.IsQuorumAchievedByMask(consensus.vc.GetViewIDBitmap(recvMsg.ViewID)) { consensus.getLogger().Info(). Int64("have", consensus.Decider.SignersCount(quorum.ViewChange)). Int64("need", consensus.Decider.TwoThirdsSignersCount()).