-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Closed
Milestone
Description
When the newly introduced "maxfeerate"
option is not passed, the default fee rate is interpreted as an absolute amount. However, when it is passed, it is interpreted as a fee rate. Thus, the rpc will return different results when the value is explicitly set to the default.
See
bitcoin/src/rpc/rawtransaction.cpp
Lines 797 to 807 in 536590f
CAmount max_raw_tx_fee = DEFAULT_MAX_RAW_TX_FEE; | |
// 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].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); |
I think we should change it back to an absolute value in BTC (not a feerate)
This was changed to a feerate by @kallewoof, so ping him to see if there was a specific reason to switch.