Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2649 from bandprotocol/update-export
Browse files Browse the repository at this point in the history
chain: add commission check before withdrawing commission when export
  • Loading branch information
taobun authored Sep 17, 2020
2 parents 7b2e8f3 + d1952fc commit f8dffa3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### Chain (Non-consensus)

- (bugs) [\#2649](https://github.com/bandprotocol/bandchain/pull/2649) Add commission check before withdraw when export

### Yoda

### Emitter & Flusher
Expand Down
4 changes: 4 additions & 0 deletions chain/app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ func (app *BandApp) prepForZeroHeightGenesis(ctx sdk.Context, jailWhiteList []st

// withdraw all validator commission
app.StakingKeeper.IterateValidators(ctx, func(_ int64, val staking.ValidatorI) (stop bool) {
accumCommission := app.DistrKeeper.GetValidatorAccumulatedCommission(ctx, val.GetOperator())
if accumCommission.IsZero() {
return false
}
_, err := app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator())
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit f8dffa3

Please sign in to comment.