Skip to content

Commit

Permalink
update disable inflation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DracoLi committed Sep 13, 2023
1 parent d306d1f commit 4931fd0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions x/community/keeper/incentives.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand Down

0 comments on commit 4931fd0

Please sign in to comment.