From dccf86adbaf54682eac52f0c262e24cbcc5f9d0f Mon Sep 17 00:00:00 2001 From: beer-1 Date: Tue, 20 Aug 2024 11:56:59 +0900 Subject: [PATCH] add pool check --- x/distribution/keeper/allocation.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/distribution/keeper/allocation.go b/x/distribution/keeper/allocation.go index bfdd6600..dc9ad13e 100644 --- a/x/distribution/keeper/allocation.go +++ b/x/distribution/keeper/allocation.go @@ -84,10 +84,10 @@ func (k Keeper) AllocateTokens(ctx context.Context, totalPreviousPower int64, bo poolReward := feesCollected.MulDecTruncate(voteMultiplier).MulDecTruncate(poolFraction) poolDenom := rewardWeight.Denom - poolSize := bondedTokensSum[poolDenom] + poolSize, ok := bondedTokensSum[poolDenom] // if poolSize is zero, skip allocation and then the poolReward will be allocated to community pool - if poolSize.IsZero() { + if !ok || poolSize.IsZero() { continue }