From 53633118f1986014d654aca58e6c149ef2e358d6 Mon Sep 17 00:00:00 2001 From: yys Date: Thu, 26 May 2022 20:07:39 +0900 Subject: [PATCH] Revert "exclude validator addresses from being genesis staking" --- app/app.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/app/app.go b/app/app.go index c24ac970..84c37af0 100644 --- a/app/app.go +++ b/app/app.go @@ -842,17 +842,13 @@ func (app *TerraApp) enforceStakingForVestingTokens(ctx sdk.Context, genesisStat allValidators := app.StakingKeeper.GetAllValidators(ctx) + // Filter out validators which have huge max commission than 20% var validators []stakingtypes.Validator - validatorAccAddressMap := make(map[string]bool) maxCommissionCondition := sdk.NewDecWithPrec(20, 2) for _, val := range allValidators { - - // Filter out validators which have huge max commission than 20% if val.Commission.CommissionRates.MaxRate.LTE(maxCommissionCondition) { validators = append(validators, val) } - - validatorAccAddressMap[sdk.AccAddress(val.GetOperator()).String()] = true } validatorLen := len(validators) @@ -872,12 +868,6 @@ func (app *TerraApp) enforceStakingForVestingTokens(ctx sdk.Context, genesisStat } if vestingAcc, ok := account.(vestingexported.VestingAccount); ok { - - // skip genesis staking if the vesting account is validator address - if _, ok := validatorAccAddressMap[vestingAcc.GetAddress().String()]; ok { - continue - } - amt := vestingAcc.GetOriginalVesting().AmountOf(app.StakingKeeper.BondDenom(ctx)) // to prevent staking multiple times over the same validator