Skip to content

Commit ad272fb

Browse files
author
avkr003
committed
fix
1 parent 17b7cda commit ad272fb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

x/masterchef/keeper/abci.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ func (k Keeper) EndBlocker(ctx sdk.Context) error {
3434
k.DeleteFeeInfo(ctx)
3535

3636
// distribute LP rewards
37-
err := k.ProcessLPRewardDistribution(ctx)
37+
cacheCtx, write := ctx.CacheContext()
38+
err := k.ProcessLPRewardDistribution(cacheCtx)
3839
if err != nil {
3940
ctx.Logger().Error(fmt.Sprintf("Failed to process lp rewards distribution: %s", err.Error()))
4041
return err
42+
} else {
43+
write()
4144
}
4245
// distribute external rewards
4346
k.ProcessExternalRewardsDistribution(ctx)
44-
4547
return nil
4648
}
4749

0 commit comments

Comments
 (0)