aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/rawtransaction.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-08-14 19:44:02 -0400
committerRussell Yanofsky <russ@yanofsky.org>2017-08-14 19:44:02 -0400
commite067673f4ea7a74b7251282b48ea9ca57416533a (patch)
tree9106b1044e0e734a76b417742f3c305a42ac9707 /src/rpc/rawtransaction.cpp
parente666efcdba527a58175f9de3357dd19bb5880178 (diff)
downloadbitcoin-e067673f4ea7a74b7251282b48ea9ca57416533a.tar.xz
Avoid treating null RPC arguments different from missing arguments
This changes RPC methods to treat null arguments the same as missing arguments, instead of throwing type errors. Specifically: - `getbalance` method now returns the wallet balance when the `account` param is null instead of throwing a type error (same as when parameter is missing). It is still an error to supply `minconf` or `watchonly` options when the account is null. - `addnode` and `setban` methods now return help text instead of type errors if `command` params are null (same as when params are missing). - `sendrawtransaction`, `setaccount`, `movecmd`, `sendfrom`, `addmultisigaddress`, `listaccounts`, `lockunspent` methods accept null default values where missing values were previously allowed, and treat them the same.
Diffstat (limited to 'src/rpc/rawtransaction.cpp')
-rw-r--r--src/rpc/rawtransaction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 9d9fef6649..10fc9c162d 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -922,7 +922,7 @@ UniValue sendrawtransaction(const JSONRPCRequest& request)
const uint256& hashTx = tx->GetHash();
CAmount nMaxRawTxFee = maxTxFee;
- if (request.params.size() > 1 && request.params[1].get_bool())
+ if (!request.params[1].isNull() && request.params[1].get_bool())
nMaxRawTxFee = 0;
CCoinsViewCache &view = *pcoinsTip;