wallet: fix bug in RPC send options

when empty, options were not being populated by arguments of the same name

found while adding test coverage in 603c0050
This commit is contained in:
Jon Atack
2020-11-05 06:34:01 +01:00
parent 155bf91c3b
commit 3f72791613
2 changed files with 15 additions and 14 deletions

View File

@@ -4087,7 +4087,7 @@ static RPCHelpMan send()
if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get();
UniValue options = request.params[3];
UniValue options{request.params[3].isNull() ? UniValue::VOBJ : request.params[3]};
if (options.exists("feeRate") || options.exists("fee_rate") || options.exists("estimate_mode") || options.exists("conf_target")) {
if (!request.params[1].isNull() || !request.params[2].isNull()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Use either conf_target and estimate_mode or the options dictionary to control fee rate");