diff options
author | fanquake <fanquake@gmail.com> | 2021-12-14 10:09:42 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-12-14 10:09:42 +0800 |
commit | eca159c305c1ff3d9b806755026a23bf2aad9a48 (patch) | |
tree | 2e835d221c19b1e2f7c17275cc1de45bc861111e | |
parent | 5dd28e5cff8a8177b969181ecb58d045e7f80a72 (diff) |
refactor: remove unneeded calls to strprintf()
-rw-r--r-- | src/init/common.cpp | 2 | ||||
-rw-r--r-- | src/node/psbt.cpp | 2 | ||||
-rw-r--r-- | src/rpc/mining.cpp | 2 | ||||
-rw-r--r-- | src/rpc/misc.cpp | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/init/common.cpp b/src/init/common.cpp index 8f9e0ebc87..38c60366e3 100644 --- a/src/init/common.cpp +++ b/src/init/common.cpp @@ -64,7 +64,7 @@ void AddLoggingArgs(ArgsManager& argsman) argsman.AddArg("-debug=<category>", "Output debugging information (default: -nodebug, supplying <category> is optional). " "If <category> is not supplied or if <category> = 1, output all debugging information. <category> can be: " + LogInstance().LogCategoriesString() + ". This option can be specified multiple times to output multiple categories.", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); - argsman.AddArg("-debugexclude=<category>", strprintf("Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except the specified category. This option can be specified multiple times to exclude multiple categories."), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); + argsman.AddArg("-debugexclude=<category>", "Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except the specified category. This option can be specified multiple times to exclude multiple categories.", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-logips", strprintf("Include IP addresses in debug output (default: %u)", DEFAULT_LOGIPS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-logtimestamps", strprintf("Prepend debug output with timestamp (default: %u)", DEFAULT_LOGTIMESTAMPS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); #ifdef HAVE_THREAD_LOCAL diff --git a/src/node/psbt.cpp b/src/node/psbt.cpp index 9ad65d15d2..0be2bdb3ef 100644 --- a/src/node/psbt.cpp +++ b/src/node/psbt.cpp @@ -105,7 +105,7 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx) } ); if (!MoneyRange(out_amt)) { - result.SetInvalid(strprintf("PSBT is not valid. Output amount invalid")); + result.SetInvalid("PSBT is not valid. Output amount invalid"); return result; } diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 66e0df906c..6e67832b31 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -184,7 +184,7 @@ static bool getScriptFromDescriptor(const std::string& descriptor, CScript& scri FlatSigningProvider provider; std::vector<CScript> scripts; if (!desc->Expand(0, key_provider, scripts, provider)) { - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Cannot derive script without private keys")); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Cannot derive script without private keys"); } // Combo descriptors can have 2 or 4 scripts, so we can't just check scripts.size() == 1 diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 2761c69167..7705051df9 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -286,13 +286,13 @@ static RPCHelpMan deriveaddresses() FlatSigningProvider provider; std::vector<CScript> scripts; if (!desc->Expand(i, key_provider, scripts, provider)) { - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Cannot derive script without private keys")); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Cannot derive script without private keys"); } for (const CScript &script : scripts) { CTxDestination dest; if (!ExtractDestination(script, dest)) { - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Descriptor does not have a corresponding address")); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Descriptor does not have a corresponding address"); } addresses.push_back(EncodeDestination(dest)); |