From 73f0b2cc34322525a4e7eddf7a990eae4f633d82 Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Fri, 2 Jul 2021 23:35:31 +0800 Subject: [PATCH] fix: Don't error on startup if min-gas-price is empty (#9621) * fix: Don't error on startup if min-gas-price is empty * remove test * Update server/start.go * Update server/start.go Co-authored-by: Aaron Craelius * Switch to error Co-authored-by: Aaron Craelius --- server/start.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/start.go b/server/start.go index b921999bf519..040ca970f1c1 100644 --- a/server/start.go +++ b/server/start.go @@ -233,6 +233,13 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App return err } + config := config.GetConfig(ctx.Viper) + if err := config.ValidateBasic(); err != nil { + ctx.Logger.Error("WARNING: The minimum-gas-prices config in app.toml is set to the empty string. " + + "This defaults to 0 in the current version, but will error in the next version " + + "(SDK v0.44). Please explicitly put the desired minimum-gas-prices in your app.toml.") + } + app := appCreator(ctx.Logger, db, traceWriter, ctx.Viper) nodeKey, err := p2p.LoadOrGenNodeKey(cfg.NodeKeyFile()) @@ -261,8 +268,6 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App } ctx.Logger.Debug("initialization: tmNode started") - config := config.GetConfig(ctx.Viper) - // Add the tx service to the gRPC router. We only need to register this // service if API or gRPC is enabled, and avoid doing so in the general // case, because it spawns a new local tendermint RPC client.