aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-04-26 09:09:50 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-05-16 14:15:40 -0400
commitfa5c5cd141f0265a5693234690ac757b811157d8 (patch)
tree4e8b37f1915f4c593e8362f9adefacd248dbbe39 /src/wallet
parent653b2b4426cf762f90707c27c3f435142c911ab6 (diff)
downloadbitcoin-fa5c5cd141f0265a5693234690ac757b811157d8.tar.xz
rpc: Switch touched RPCs to IsValidNumArgs
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/rpcwallet.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 7de74bac4d..6cb3deb591 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -2991,9 +2991,7 @@ static UniValue fundrawtransaction(const JSONRPCRequest& request)
return NullUniValue;
}
- if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)
- throw std::runtime_error(
- RPCHelpMan{"fundrawtransaction",
+ const RPCHelpMan help{"fundrawtransaction",
"\nAdd inputs to a transaction until it has enough in value to meet its out value.\n"
"This will not modify existing inputs, and will add at most one change output to the outputs.\n"
"No existing outputs will be modified unless \"subtractFeeFromOutputs\" is specified.\n"
@@ -3052,7 +3050,11 @@ static UniValue fundrawtransaction(const JSONRPCRequest& request)
"\nSend the transaction\n"
+ HelpExampleCli("sendrawtransaction", "\"signedtransactionhex\"")
},
- }.ToString());
+ };
+
+ if (request.fHelp || !help.IsValidNumArgs(request.params.size())) {
+ throw std::runtime_error(help.ToString());
+ }
RPCTypeCheck(request.params, {UniValue::VSTR, UniValueType(), UniValue::VBOOL});