mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 15:04:22 +00:00
* consensus: check proposal non-nil in prevote message delay metric (#7625)
(cherry picked from commit b6307c42e0)
# Conflicts:
# consensus/state.go
* fix merge conflicts
Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
Co-authored-by: William Banfield <wbanfield@gmail.com>
This commit is contained in:
co-authored by
William Banfield
William Banfield
parent
f36cc80568
commit
80f656d8d7
@@ -2278,11 +2278,17 @@ func (cs *State) checkDoubleSigningRisk(height int64) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cs *State) calculatePrevoteMessageDelayMetrics() {
|
func (cs *State) calculatePrevoteMessageDelayMetrics() {
|
||||||
|
if cs.Proposal == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
ps := cs.Votes.Prevotes(cs.Round)
|
ps := cs.Votes.Prevotes(cs.Round)
|
||||||
pl := ps.List()
|
pl := ps.List()
|
||||||
|
|
||||||
sort.Slice(pl, func(i, j int) bool {
|
sort.Slice(pl, func(i, j int) bool {
|
||||||
return pl[i].Timestamp.Before(pl[j].Timestamp)
|
return pl[i].Timestamp.Before(pl[j].Timestamp)
|
||||||
})
|
})
|
||||||
|
|
||||||
var votingPowerSeen int64
|
var votingPowerSeen int64
|
||||||
for _, v := range pl {
|
for _, v := range pl {
|
||||||
_, val := cs.Validators.GetByAddress(v.ValidatorAddress)
|
_, val := cs.Validators.GetByAddress(v.ValidatorAddress)
|
||||||
|
|||||||
Reference in New Issue
Block a user