From 4931fd0e6401ab653af53ed50792e97ede69bbff Mon Sep 17 00:00:00 2001 From: Draco Date: Wed, 13 Sep 2023 15:41:03 -0400 Subject: [PATCH] update disable inflation comments --- x/community/keeper/incentives.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/x/community/keeper/incentives.go b/x/community/keeper/incentives.go index c6484cfd99..42c50d9d60 100644 --- a/x/community/keeper/incentives.go +++ b/x/community/keeper/incentives.go @@ -13,13 +13,12 @@ func (k Keeper) PayCommunityRewards(ctx sdk.Context) error { func (k Keeper) DisableInflationAfterUpgrade(ctx sdk.Context) { logger := k.Logger(ctx) - // check if the upgrade time has passed params, found := k.GetParams(ctx) if !found { return } - // skip if we have already upgraded - previousBlockTime is only set on upgrade. + // skip if we have already upgraded - previousBlockTime is first set on upgrade. _, found = k.GetPreviousBlockTime(ctx) if found { return @@ -28,9 +27,9 @@ func (k Keeper) DisableInflationAfterUpgrade(ctx sdk.Context) { blockTime := ctx.BlockTime() upgradeTime := params.UpgradeTimeDisableInflation - // note: a vanilla kava chain should disable inflation after the first block, so we - // only skip upgrade here if the upgradeTime both set and in the future. - if blockTime.Before(upgradeTime) && !upgradeTime.IsZero() { + // a vanilla kava chain should disable inflation on the first block, so we + // only skip upgrade here if `upgradeTime` is set and `blockTime` is before `upgradeTime` + if !upgradeTime.IsZero() && blockTime.Before(upgradeTime) { return }