aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2019-04-26 09:09:50 -0400
committerMarcoFalke <[email protected]>2019-06-18 09:32:17 -0400
commitbb36ac82efb576d12b7ddac2c3f9277be9a74c2e (patch)
tree0ce843228c426ff3963e756e02f13dffc595bc64 /src/wallet/rpcwallet.cpp
parentAdd example 2nd arg to signrawtransactionwithkey (diff)
downloaddiscoin-bb36ac82efb576d12b7ddac2c3f9277be9a74c2e.tar.xz
discoin-bb36ac82efb576d12b7ddac2c3f9277be9a74c2e.zip
rpc: Switch touched RPCs to IsValidNumArgs
Github-Pull: #15899 Rebased-From: fa5c5cd141f0265a5693234690ac757b811157d8
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-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 9393d8657..14c06624a 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -3040,9 +3040,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"
@@ -3101,7 +3099,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});