diff options
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 91331198e2..1a7216ceeb 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -818,15 +818,13 @@ static UniValue sendrawtransaction(const JSONRPCRequest& request) // TODO: temporary migration code for old clients. Remove in v0.20 if (request.params[1].isBool()) { throw JSONRPCError(RPC_INVALID_PARAMETER, "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 weight = GetTransactionWeight(*tx); CFeeRate fr(AmountFromValue(request.params[1])); // the +3/4 part rounds the value up, and is the same formula used when // calculating the fee for a transaction // (see GetVirtualTransactionSize) max_raw_tx_fee = fr.GetFee((weight+3)/4); - } else if (!request.params[1].isNull()) { - throw JSONRPCError(RPC_INVALID_PARAMETER, "second argument (maxfeerate) must be numeric"); } uint256 txid; @@ -900,15 +898,13 @@ static UniValue testmempoolaccept(const JSONRPCRequest& request) // TODO: temporary migration code for old clients. Remove in v0.20 if (request.params[1].isBool()) { throw JSONRPCError(RPC_INVALID_PARAMETER, "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 weight = GetTransactionWeight(*tx); CFeeRate fr(AmountFromValue(request.params[1])); // the +3/4 part rounds the value up, and is the same formula used when // calculating the fee for a transaction // (see GetVirtualTransactionSize) max_raw_tx_fee = fr.GetFee((weight+3)/4); - } else if (!request.params[1].isNull()) { - throw JSONRPCError(RPC_INVALID_PARAMETER, "second argument (maxfeerate) must be numeric"); } UniValue result(UniValue::VARR); |