init commit (#6503)

This commit is contained in:
Alexander Bezobchuk 2020-06-24 10:07:26 -04:00 committed by GitHub
parent ab18c3fae0
commit cb6c552e05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -84,11 +84,24 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer) server.Applicati
skipUpgradeHeights[int64(h)] = true
}
pruningStr := viper.GetString(server.FlagPruning)
pruningOpts := storetypes.NewPruningOptionsFromString(pruningStr)
// If 'custom' strategy is provided, we construct the options from individual
// flags. We assume the values have been verified already.
if pruningStr == storetypes.PruningOptionCustom {
pruningOpts = storetypes.NewPruningOptions(
viper.GetUint64(server.FlagPruningKeepRecent),
viper.GetUint64(server.FlagPruningKeepEvery),
viper.GetUint64(server.FlagPruningInterval),
)
}
// TODO: Make sure custom pruning works.
return simapp.NewSimApp(
logger, db, traceStore, true, skipUpgradeHeights,
viper.GetString(flags.FlagHome), invCheckPeriod,
baseapp.SetPruning(storetypes.NewPruningOptionsFromString(viper.GetString(server.FlagPruning))),
baseapp.SetPruning(pruningOpts),
baseapp.SetMinGasPrices(viper.GetString(server.FlagMinGasPrices)),
baseapp.SetHaltHeight(viper.GetUint64(server.FlagHaltHeight)),
baseapp.SetHaltTime(viper.GetUint64(server.FlagHaltTime)),