Skip to content

Commit

Permalink
Merge pull request #103 from disperze/fix-max-rate-validators
Browse files Browse the repository at this point in the history
Fix min-commission upgrade [moneta-beta]
  • Loading branch information
JakeHartnell authored Nov 28, 2021
2 parents 547f4bf + d551833 commit 41ef6f1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,12 @@ func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) {
minCommissionRate := sdk.NewDecWithPrec(5, 2)
for _, v := range validators {
if v.Commission.Rate.LT(minCommissionRate) {
comm, err := app.StakingKeeper.UpdateValidatorCommission(
ctx, v, minCommissionRate)
if err != nil {
panic(err)
if v.Commission.MaxRate.LT(minCommissionRate) {
v.Commission.MaxRate = minCommissionRate
}
v.Commission = comm

v.Commission.Rate = minCommissionRate
v.Commission.UpdateTime = ctx.BlockHeader().Time

// call the before-modification hook since we're about to update the commission
app.StakingKeeper.BeforeValidatorModified(ctx, v.GetOperator())
Expand Down

0 comments on commit 41ef6f1

Please sign in to comment.