Merge PR #3750: Outstanding per-validator rewards; correctly handle same-BeginBlock redelegation-double-slash

This commit is contained in:
Christopher Goes
2019-03-06 19:54:12 +01:00
committed by GitHub
parent bf7cbbbdf8
commit 4c50380181
39 changed files with 526 additions and 256 deletions
+7
View File
@@ -104,6 +104,13 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailWhiteList []st
// reinitialize all validators
app.stakingKeeper.IterateValidators(ctx, func(_ int64, val sdk.Validator) (stop bool) {
// donate any unwithdrawn outstanding reward fraction tokens to the community pool
scraps := app.distrKeeper.GetValidatorOutstandingRewards(ctx, val.GetOperator())
feePool := app.distrKeeper.GetFeePool(ctx)
feePool.CommunityPool = feePool.CommunityPool.Add(scraps)
app.distrKeeper.SetFeePool(ctx, feePool)
app.distrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator())
return false
})