aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-12-14 10:09:42 +0800
committerfanquake <fanquake@gmail.com>2021-12-14 10:09:42 +0800
commiteca159c305c1ff3d9b806755026a23bf2aad9a48 (patch)
tree2e835d221c19b1e2f7c17275cc1de45bc861111e /src/rpc
parent5dd28e5cff8a8177b969181ecb58d045e7f80a72 (diff)
refactor: remove unneeded calls to strprintf()
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/mining.cpp2
-rw-r--r--src/rpc/misc.cpp4
2 files changed, 3 insertions, 3 deletions
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));