Skip to content

Commit eca159c

Browse files
committed
refactor: remove unneeded calls to strprintf()
1 parent 5dd28e5 commit eca159c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/init/common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void AddLoggingArgs(ArgsManager& argsman)
6464
argsman.AddArg("-debug=<category>", "Output debugging information (default: -nodebug, supplying <category> is optional). "
6565
"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.",
6666
ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
67-
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);
67+
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);
6868
argsman.AddArg("-logips", strprintf("Include IP addresses in debug output (default: %u)", DEFAULT_LOGIPS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
6969
argsman.AddArg("-logtimestamps", strprintf("Prepend debug output with timestamp (default: %u)", DEFAULT_LOGTIMESTAMPS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
7070
#ifdef HAVE_THREAD_LOCAL

src/node/psbt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
105105
}
106106
);
107107
if (!MoneyRange(out_amt)) {
108-
result.SetInvalid(strprintf("PSBT is not valid. Output amount invalid"));
108+
result.SetInvalid("PSBT is not valid. Output amount invalid");
109109
return result;
110110
}
111111

src/rpc/mining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static bool getScriptFromDescriptor(const std::string& descriptor, CScript& scri
184184
FlatSigningProvider provider;
185185
std::vector<CScript> scripts;
186186
if (!desc->Expand(0, key_provider, scripts, provider)) {
187-
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Cannot derive script without private keys"));
187+
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Cannot derive script without private keys");
188188
}
189189

190190
// Combo descriptors can have 2 or 4 scripts, so we can't just check scripts.size() == 1

src/rpc/misc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,13 @@ static RPCHelpMan deriveaddresses()
286286
FlatSigningProvider provider;
287287
std::vector<CScript> scripts;
288288
if (!desc->Expand(i, key_provider, scripts, provider)) {
289-
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Cannot derive script without private keys"));
289+
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Cannot derive script without private keys");
290290
}
291291

292292
for (const CScript &script : scripts) {
293293
CTxDestination dest;
294294
if (!ExtractDestination(script, dest)) {
295-
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Descriptor does not have a corresponding address"));
295+
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Descriptor does not have a corresponding address");
296296
}
297297

298298
addresses.push_back(EncodeDestination(dest));

0 commit comments

Comments
 (0)