diff --git a/consensus/state.go b/consensus/state.go index 96c1622a6..ea0212f91 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -2404,9 +2404,9 @@ func (cs *State) calculatePrevoteMessageDelayMetrics() { }) var votingPowerSeen int64 for _, v := range pl { - _, val := cs.Validators.GetByAddress(v.ValidatorAddress) - votingPowerSeen += val.VotingPower - if votingPowerSeen >= cs.Validators.TotalVotingPower()*2/3+1 { + _, voter := cs.Voters.GetByAddress(v.ValidatorAddress) + votingPowerSeen += voter.VotingPower + if votingPowerSeen >= cs.Voters.TotalVotingPower()*2/3+1 { cs.metrics.QuorumPrevoteMessageDelay.Set(v.Timestamp.Sub(cs.Proposal.Timestamp).Seconds()) break } diff --git a/types/validator_set.go b/types/validator_set.go index 9074cdf89..ed16f98dc 100644 --- a/types/validator_set.go +++ b/types/validator_set.go @@ -331,8 +331,8 @@ func (vals *ValidatorSet) updateTotalStakingPower() { vals.totalStakingPower = sum } -// TotalStakingPower returns the sum of the voting powers of all validators. -// It recomputes the total voting power if required. +// TotalStakingPower returns the sum of the staking powers of all validators. +// It recomputes the total staking power if required. func (vals *ValidatorSet) TotalStakingPower() int64 { if vals.totalStakingPower == 0 { vals.updateTotalStakingPower()