Avoid treating null RPC arguments different from missing arguments
commite067673f4ea7a74b7251282b48ea9ca57416533a
authorRussell Yanofsky <russ@yanofsky.org>
Mon, 14 Aug 2017 23:44:02 +0000 (14 19:44 -0400)
committerRussell Yanofsky <russ@yanofsky.org>
Mon, 14 Aug 2017 23:44:02 +0000 (14 19:44 -0400)
tree9106b1044e0e734a76b417742f3c305a42ac9707
parente666efcdba527a58175f9de3357dd19bb5880178
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.
src/rpc/net.cpp
src/rpc/rawtransaction.cpp
src/wallet/rpcwallet.cpp