From d3d97beb0d6b73eba89fdaef8290adafb8274c36 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 21 Feb 2024 14:51:05 +0100 Subject: [PATCH] address comments --- x/ccv/provider/keeper/distribution.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index 15c1885e6b..45af3eb262 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -101,7 +101,7 @@ func (k Keeper) AllocateTokens(ctx sdk.Context, totalPreviousPower int64, bonded // temporary workaround to keep CanWithdrawInvariant happy // general discussions here: https://github.com/cosmos/cosmos-sdk/issues/2906#issuecomment-441867634 feePool := k.distributionKeeper.GetFeePool(ctx) - if totalPreviousPower == 0 { + if k.ComputeConsumerTotalVotingPower(ctx, consumer.ChainId, bondedVotes) == 0 { feePool.CommunityPool = feePool.CommunityPool.Add(rewardsCollectedDec...) k.distributionKeeper.SetFeePool(ctx, feePool) return @@ -232,7 +232,6 @@ func (k Keeper) GetConsumerRewardsPool(ctx sdk.Context) sdk.Coins { func (k Keeper) ComputeConsumerTotalVotingPower(ctx sdk.Context, chainID string, votes []abci.VoteInfo) int64 { // TODO: create a optedIn set from the OptedIn validators // and sum their validator power - var totalPower int64 // sum the opted-in validators set voting powers