diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 863b495fb25..79410b73035 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -1059,7 +1059,7 @@ static void ParseGetInfoResult(UniValue& result) } #endif - if (gArgs.IsArgSet("-color")) { + { const std::string color{gArgs.GetArg("-color", DEFAULT_COLOR_SETTING)}; if (color == "always") { should_colorize = true; diff --git a/src/init.cpp b/src/init.cpp index fae45eb90a5..863bedb550a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1044,14 +1044,14 @@ bool AppInitParameterInteraction(const ArgsManager& args) } } - if (args.IsArgSet("-blockmaxweight")) { + { const auto max_block_weight = args.GetIntArg("-blockmaxweight", DEFAULT_BLOCK_MAX_WEIGHT); if (max_block_weight > MAX_BLOCK_WEIGHT) { return InitError(strprintf(_("Specified -blockmaxweight (%d) exceeds consensus maximum block weight (%d)"), max_block_weight, MAX_BLOCK_WEIGHT)); } } - if (args.IsArgSet("-blockreservedweight")) { + { const auto block_reserved_weight = args.GetIntArg("-blockreservedweight", DEFAULT_BLOCK_RESERVED_WEIGHT); if (block_reserved_weight > MAX_BLOCK_WEIGHT) { return InitError(strprintf(_("Specified -blockreservedweight (%d) exceeds consensus maximum block weight (%d)"), block_reserved_weight, MAX_BLOCK_WEIGHT));