Skip to content

Commit

Permalink
fix tally to correctly collect ballot losers
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun committed Oct 14, 2019
1 parent 87ec62a commit 1655e0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x/oracle/tally.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ func tally(ctx sdk.Context, pb types.PriceBallot, k Keeper) (weightedMedian sdk.
}

for _, vote := range pb {
if vote.Price.GTE(weightedMedian.Sub(rewardSpread)) && vote.Price.LTE(weightedMedian.Add(rewardSpread)) {
if validator := k.StakingKeeper.Validator(ctx, vote.Voter); validator != nil {
// If a validator is not found, then just ignore the vote
if validator := k.StakingKeeper.Validator(ctx, vote.Voter); validator != nil {
if vote.Price.GTE(weightedMedian.Sub(rewardSpread)) && vote.Price.LTE(weightedMedian.Add(rewardSpread)) {
power := validator.GetConsensusPower()

ballotWinners = append(ballotWinners, types.Claim{
Expand Down

0 comments on commit 1655e0b

Please sign in to comment.