You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #20220: wallet, rpc: explicit fee rate follow-ups/fixes for 0.21
0be2900 rpc: update conf_target helps for correctness/consistency (Jon Atack)
778b9be wallet, rpc: fix send subtract_fee_from_outputs help (Jon Atack)
603c005 wallet: add rpc send explicit fee rate coverage (Jon Atack)
dd341e6 wallet: add sendtoaddress/sendmany explicit fee rate coverage (Jon Atack)
44e7bfa wallet: add walletcreatefundedpsbt explicit fee rate coverage (Jon Atack)
6e1ea42 test: refactor for walletcreatefundedpsbt fee rate coverage (Jon Atack)
3ac7b0c wallet: fundrawtx fee rate coverage, fixup ParseConfirmTarget() (Jon Atack)
2d8eba8 wallet: combine redundant bumpfee invalid params and args tests (Jon Atack)
1697a40 wallet: improve bumpfee error/help, add explicit fee rate coverage (Jon Atack)
fc57217 wallet: fix SetFeeEstimateMode() error message (Jon Atack)
052427e wallet, bugfix: fix bumpfee with explicit fee rate modes (Jon Atack)
Pull request description:
Follow-up to #11413 providing a base to build on for #19543:
- bugfix for `bumpfee` raising a JSON error with explicit feerates, fixes issue #20219
- adds explicit feerate test coverage for `bumpfee`, `fundrawtransaction`, `walletcreatefundedpsbt`, `send`, `sendtoaddress`, and `sendmany`
- improves a few related RPC error messages and `ParseConfirmTarget()` / error message
- fixes/improves the explicit fee rate information in the 6 RPC helps, of which 2 were also missing `conf_target` sat/B units
This provides a spec and regression coverage for the potential next step of a universal `sat/vB` feerate argument (see #19543), as well as immediate coverage and minimum fixes for 0.21.
ACKs for top commit:
kallewoof:
Concept/Tested ACK 0be2900
meshcollider:
Code review + functional test run ACK 0be2900
Tree-SHA512: efd965003e991cba51d4504e2940f06ab3d742e34022e96a673606b44fad85596aa03a8c1809f06df7ebcf21a38e18a891e54392fe3d6fb4d120bbe4ea0cf5e0
if (cc.m_fee_mode == FeeEstimateMode::BTC_KB || cc.m_fee_mode == FeeEstimateMode::SAT_B) {
216
216
if (estimate_param.isNull()) {
217
-
throwJSONRPCError(RPC_INVALID_PARAMETER, "Selected estimate_mode requires a fee rate");
217
+
throwJSONRPCError(RPC_INVALID_PARAMETER, strprintf("Selected estimate_mode %s requires a fee rate to be specified in conf_target", estimate_mode.get_str()));
{"subtractfeefromamount", RPCArg::Type::BOOL, /* default */"false", "The fee will be deducted from the amount being sent.\n"
441
441
"The recipient will receive less bitcoins than you enter in the amount field."},
442
442
{"replaceable", RPCArg::Type::BOOL, /* default */"wallet default", "Allow this transaction to be replaced by a transaction with higher fees via BIP 125"},
443
-
{"conf_target", RPCArg::Type::NUM, /* default */"wallet default", "Confirmation target (in blocks), or fee rate (for " + CURRENCY_UNIT + "/kB or " + CURRENCY_ATOM + "/B estimate modes)"},
443
+
{"conf_target", RPCArg::Type::NUM, /* default */"wallet -txconfirmtarget", "Confirmation target (in blocks)\n"
{"estimate_mode", RPCArg::Type::STR, /* default */"unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
445
446
"\"" + FeeModes("\"\n\"") + "\""},
446
447
{"avoid_reuse", RPCArg::Type::BOOL, /* default */"true", "(only available if avoid_reuse wallet flag is set) Avoid spending from dirty addresses; addresses are considered\n"
@@ -868,7 +869,8 @@ static RPCHelpMan sendmany()
868
869
},
869
870
},
870
871
{"replaceable", RPCArg::Type::BOOL, /* default */"wallet default", "Allow this transaction to be replaced by a transaction with higher fees via BIP 125"},
871
-
{"conf_target", RPCArg::Type::NUM, /* default */"wallet default", "Confirmation target (in blocks), or fee rate (for " + CURRENCY_UNIT + "/kB or " + CURRENCY_ATOM + "/B estimate modes)"},
872
+
{"conf_target", RPCArg::Type::NUM, /* default */"wallet -txconfirmtarget", "Confirmation target (in blocks)\n"
"The command will pay the additional fee by reducing change outputs or adding inputs when necessary. It may add a new change output if one does not already exist.\n"
3379
3382
"All inputs in the original transaction will be included in the replacement transaction.\n"
3380
3383
"The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\n"
3381
-
"By default, the new fee will be calculated automatically using estimatesmartfee.\n"
3384
+
"By default, the new fee will be calculated automatically using the estimatesmartfee RPC.\n"
3382
3385
"The user can specify a confirmation target for estimatesmartfee.\n"
3383
3386
"Alternatively, the user can specify a fee_rate (" + CURRENCY_UNIT + " per kB) for the new transaction.\n"
3384
3387
"At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee\n"
throwJSONRPCError(RPC_INVALID_PARAMETER, "conf_target can't be set with fee_rate. Please provide either a confirmation target in blocks for automatic fee estimation, or an explicit fee rate.");
3471
+
throwJSONRPCError(RPC_INVALID_PARAMETER, "Cannot specify both conf_target and fee_rate. Please provide either a confirmation target in blocks for automatic fee estimation, or an explicit fee rate.");
{"change_address", RPCArg::Type::STR_HEX, /* default */"pool address", "The bitcoin address to receive the change"},
4025
4029
{"change_position", RPCArg::Type::NUM, /* default */"random", "The index of the change output"},
4026
4030
{"change_type", RPCArg::Type::STR, /* default */"set by -changetype", "The output type to use. Only valid if change_address is not specified. Options are \"legacy\", \"p2sh-segwit\", and \"bech32\"."},
4027
-
{"conf_target", RPCArg::Type::NUM, /* default */"wallet default", "Confirmation target (in blocks), or fee rate (for " + CURRENCY_UNIT + "/kB or " + CURRENCY_ATOM + "/B estimate modes)"},
4031
+
{"conf_target", RPCArg::Type::NUM, /* default */"wallet -txconfirmtarget", "Confirmation target (in blocks)\n"
0 commit comments