mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user