diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -932,13 +932,10 @@ "Second argument must be numeric (maxfeerate) and " "no longer supports a boolean. To allow a " "transaction with high fees, set maxfeerate to 0."); - } else if (request.params[1].isNum()) { + } else if (!request.params[1].isNull()) { size_t sz = tx->GetTotalSize(); CFeeRate fr(AmountFromValue(request.params[1])); max_raw_tx_fee = fr.GetFee(sz); - } else if (!request.params[1].isNull()) { - throw JSONRPCError(RPC_INVALID_PARAMETER, - "second argument (maxfeerate) must be numeric"); } std::string err_string; AssertLockNotHeld(cs_main); @@ -1032,13 +1029,10 @@ "Second argument must be numeric (maxfeerate) and " "no longer supports a boolean. To allow a " "transaction with high fees, set maxfeerate to 0."); - } else if (request.params[1].isNum()) { + } else if (!request.params[1].isNull()) { size_t sz = tx->GetTotalSize(); CFeeRate fr(AmountFromValue(request.params[1])); max_raw_tx_fee = fr.GetFee(sz); - } else if (!request.params[1].isNull()) { - throw JSONRPCError(RPC_INVALID_PARAMETER, - "second argument (maxfeerate) must be numeric"); } UniValue result(UniValue::VARR); diff --git a/test/functional/rpc_rawtransaction.py b/test/functional/rpc_rawtransaction.py --- a/test/functional/rpc_rawtransaction.py +++ b/test/functional/rpc_rawtransaction.py @@ -566,11 +566,11 @@ 0.00001000) # And below calls should both succeed testres = self.nodes[2].testmempoolaccept( - rawtxs=[rawTxSigned['hex']], maxfeerate=0.00007000)[0] + rawtxs=[rawTxSigned['hex']], maxfeerate='0.00007000')[0] assert_equal(testres['allowed'], True) self.nodes[2].sendrawtransaction( hexstring=rawTxSigned['hex'], - maxfeerate=0.00007000) + maxfeerate='0.00007000') ########################################## # Decoding weird scripts in transactions #