Browse Source

consensus: check proposal non-nil in prevote message delay metric (#7625)

pull/7608/head
William Banfield 3 years ago
committed by GitHub
parent
commit
b6307c42e0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      internal/consensus/state.go

+ 5
- 0
internal/consensus/state.go View File

@ -2399,11 +2399,16 @@ func (cs *State) checkDoubleSigningRisk(height int64) error {
}
func (cs *State) calculatePrevoteMessageDelayMetrics() {
if cs.Proposal == nil {
return
}
ps := cs.Votes.Prevotes(cs.Round)
pl := ps.List()
sort.Slice(pl, func(i, j int) bool {
return pl[i].Timestamp.Before(pl[j].Timestamp)
})
var votingPowerSeen int64
for _, v := range pl {
_, val := cs.Validators.GetByAddress(v.ValidatorAddress)


Loading…
Cancel
Save