diff --git a/x/rewards/keeper/iprpc.go b/x/rewards/keeper/iprpc.go index f6dd513d78..b511bc9d90 100644 --- a/x/rewards/keeper/iprpc.go +++ b/x/rewards/keeper/iprpc.go @@ -63,6 +63,7 @@ func (k Keeper) addSpecFunds(ctx sdk.Context, spec string, fund sdk.Coins, durat if iprpcReward.SpecFunds[i].Spec == spec { specFound = true iprpcReward.SpecFunds[i].Fund = iprpcReward.SpecFunds[i].Fund.Add(fund...) + break } } if !specFound { diff --git a/x/rewards/keeper/providers.go b/x/rewards/keeper/providers.go index 890004dadf..1ef5260092 100644 --- a/x/rewards/keeper/providers.go +++ b/x/rewards/keeper/providers.go @@ -67,8 +67,8 @@ func (k Keeper) distributeMonthlyBonusRewards(ctx sdk.Context) { specTotalPayout = k.specTotalPayout(ctx, total, sdk.NewDecFromInt(totalbasepay), spec) } // distribute the rewards to all providers - if !specTotalPayout.IsZero() { - for _, basepay := range basepays { + for _, basepay := range basepays { + if !specTotalPayout.IsZero() { // calculate the providers bonus base on adjusted base pay reward := specTotalPayout.Mul(basepay.TotalAdjusted).QuoInt(totalbasepay).TruncateInt() totalRewarded = totalRewarded.Add(reward) @@ -90,10 +90,10 @@ func (k Keeper) distributeMonthlyBonusRewards(ctx sdk.Context) { } details[providerAddr.String()+" "+spec.ChainID] = reward.String() - - // count iprpc cu - k.countIprpcCu(specCuMap, basepay.IprpcCu, spec.ChainID, basepay.Provider) } + + // count iprpc cu + k.countIprpcCu(specCuMap, basepay.IprpcCu, spec.ChainID, basepay.Provider) } }