mirror of
https://github.com/tendermint/tendermint.git
synced 2026-05-29 10:30:20 +00:00
update percentage metric when height and round match
This commit is contained in:
@@ -1017,9 +1017,6 @@ func (cs *State) handleMsg(ctx context.Context, mi msgInfo) {
|
||||
// if the vote gives us a 2/3-any or 2/3-one, we transition
|
||||
added, err = cs.tryAddVote(ctx, msg.Vote, peerID)
|
||||
if added {
|
||||
vals := cs.state.Validators
|
||||
_, val := vals.GetByIndex(msg.Vote.ValidatorIndex)
|
||||
cs.metrics.MarkVoteReceived(msg.Vote.Type, val.VotingPower, vals.TotalVotingPower())
|
||||
select {
|
||||
case cs.statsMsgQueue <- mi:
|
||||
case <-ctx.Done():
|
||||
@@ -2355,6 +2352,11 @@ func (cs *State) addVote(
|
||||
// Either duplicate, or error upon cs.Votes.AddByIndex()
|
||||
return
|
||||
}
|
||||
if vote.Round == cs.Round {
|
||||
vals := cs.state.Validators
|
||||
_, val := vals.GetByIndex(vote.ValidatorIndex)
|
||||
cs.metrics.MarkVoteReceived(vote.Type, val.VotingPower, vals.TotalVotingPower())
|
||||
}
|
||||
|
||||
if err := cs.eventBus.PublishEventVote(types.EventDataVote{Vote: vote}); err != nil {
|
||||
return added, err
|
||||
|
||||
Reference in New Issue
Block a user