diff options
| author | MarcoFalke <[email protected]> | 2019-04-26 09:09:50 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2019-05-16 14:15:40 -0400 |
| commit | fa5c5cd141f0265a5693234690ac757b811157d8 (patch) | |
| tree | 4e8b37f1915f4c593e8362f9adefacd248dbbe39 /src/wallet | |
| parent | Merge #15893: Add test for superfluous witness record in deserialization (diff) | |
| download | discoin-fa5c5cd141f0265a5693234690ac757b811157d8.tar.xz discoin-fa5c5cd141f0265a5693234690ac757b811157d8.zip | |
rpc: Switch touched RPCs to IsValidNumArgs
Diffstat (limited to 'src/wallet')
| -rw-r--r-- | src/wallet/rpcwallet.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 7de74bac4..6cb3deb59 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}); |