Skip to content

Commit 99235e2

Browse files
committed
fix
1 parent cdd876b commit 99235e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

x/protocolpool/keeper/keeper.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ func (k Keeper) IterateAndUpdateFundsDistribution(ctx context.Context) error {
221221
toDistribute := map[string]sdk.Coins{}
222222
poolFunds := sdk.NewCoins()
223223
amountToDistribute := sdk.NewCoins() // amount assigned to distributions
224-
totalDistribution := sdk.NewCoins() // total amount distributed to the pool, to then calculate the remaining pool funds
224+
allDistributions := sdk.NewCoins() // total amount distributed to the pool, to then calculate the remaining pool funds
225225

226226
if err = k.Distributions.Walk(ctx, nil, func(key time.Time, amount types.DistributionAmount) (stop bool, err error) {
227227
percentageToDistribute := math.LegacyZeroDec()
228-
totalDistribution = totalDistribution.Add(amount.Amount...)
228+
allDistributions = allDistributions.Add(amount.Amount...)
229229

230230
for _, f := range funds {
231231
if f.Expiry != nil && f.Expiry.Before(key) {
@@ -272,7 +272,7 @@ func (k Keeper) IterateAndUpdateFundsDistribution(ctx context.Context) error {
272272
}
273273
}
274274

275-
poolFunds = totalDistribution.Sub(amountToDistribute...)
275+
poolFunds = allDistributions.Sub(amountToDistribute...)
276276
if !poolFunds.IsZero() {
277277
if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ProtocolPoolDistrAccount, types.ModuleName, poolFunds); err != nil {
278278
return err

0 commit comments

Comments
 (0)