Skip to content

Commit

Permalink
Merge pull request #141 from stratosnet/qb-1094_filter_out_empty_resu…
Browse files Browse the repository at this point in the history
…lt_from_api

fix/qb-1094 filter out empty outputs from pot/rewards/epoch/epoch API
  • Loading branch information
alexstratos authored Mar 31, 2022
2 parents 4602919 + b39df70 commit de4d6a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion x/pot/keeper/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ func (k Keeper) getPotRewardsByReportEpoch(ctx sdk.Context, params types.QueryPo
}
} else {
k.IteratorIndividualReward(ctx, matureEpoch, func(walletAddress sdk.AccAddress, individualReward types.Reward) (stop bool) {
res = append(res, individualReward)
if !((individualReward.RewardFromMiningPool.Empty() || individualReward.RewardFromMiningPool.IsZero()) &&
(individualReward.RewardFromTrafficPool.Empty() || individualReward.RewardFromTrafficPool.IsZero())) {
res = append(res, individualReward)
}
return false
})
}
Expand Down

0 comments on commit de4d6a3

Please sign in to comment.