diff --git a/chain/app/genesis-tools/genesis-single-validator.go b/chain/app/genesis-tools/genesis-single-validator.go index 833943f8c..559bf225b 100644 --- a/chain/app/genesis-tools/genesis-single-validator.go +++ b/chain/app/genesis-tools/genesis-single-validator.go @@ -117,14 +117,13 @@ func SetDistributionSingleValidator(cdc codec.Codec, genesisState *GenesisState, // Get distribution module and set community pool == distribution module balance (rewards are now removed, so this is to get the balance to add up correctly) distModuleAccount, found := GetModuleAccount(cdc, genesisState, distrtypes.ModuleName) - if !found { - log.Panicf("%s module account not found", distrtypes.ModuleName) - } - distrModuleBalance, found := GetBalanceOfAddress(genesisState, distModuleAccount.GetAddress().String(), params.BaseCoinDenom) - if !found { - log.Panicf("%s distrModuleBalance not found", distrtypes.ModuleName) + if found { + distrModuleBalance, found := GetBalanceOfAddress(genesisState, distModuleAccount.GetAddress().String(), params.BaseCoinDenom) + if !found { + log.Panicf("%s distrModuleBalance not found", distrtypes.ModuleName) + } + genesisState.DistrGenesis.FeePool.CommunityPool = sdk.NewDecCoins(sdk.NewDecCoin(params.BaseCoinDenom, distrModuleBalance.Amount)) } - genesisState.DistrGenesis.FeePool.CommunityPool = sdk.NewDecCoins(sdk.NewDecCoin(params.BaseCoinDenom, distrModuleBalance.Amount)) // Since we are removing all previous validators, we need to remove the slashing events to make event numbers add up correctly genesisState.DistrGenesis.ValidatorSlashEvents = []distrtypes.ValidatorSlashEventRecord{}