fix divide by 0

This commit is contained in:
William Banfield
2022-01-10 18:32:39 -05:00
parent 2bcc983aa3
commit 6400876607
+1 -1
View File
@@ -2427,7 +2427,7 @@ func (cs *State) calculatePrevoteMessageDelayMetrics() {
for _, v := range pl {
_, val := cs.Validators.GetByAddress(v.ValidatorAddress)
votingPowerSeen += val.VotingPower
if votingPowerSeen >= cs.Validators.TotalVotingPower()*(2/3+1) {
if votingPowerSeen >= cs.Validators.TotalVotingPower()*2/3+1 {
cs.metrics.QuorumPrevoteMessageDelay.Set(v.Timestamp.Sub(cs.Proposal.Timestamp).Seconds())
break
}