Skip to content

Commit

Permalink
init commit (#6503)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez authored Jun 24, 2020
1 parent ab18c3f commit cb6c552
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion simapp/cmd/simd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit cb6c552

Please sign in to comment.