Skip to content

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Oct 26, 2020

Expects fee_mode for explicit feerate modes instead of overloading conf_target (positional args still accept either for now; that can be restricted once we finally have #17356).

fundrawtransaction used to expect its option to be called feeRate, diverging from other fee_rate option names. It now accepts either, with feeRate soft-deprecated.

fundrawtransaction and bumpfee still accept fee_rate without estimate_mode for backward compatibility.

Borrows tests from #20220 (adapted for interface changes). (NOTE: NOT including 9ea6d39 77a4f98 f97a3cd)

@luke-jr
Copy link
Member Author

luke-jr commented Oct 26, 2020

@jonatack What do you think of this approach? (Actually what I thought it already was!)

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 27, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

if (options.exists("feeRate") && options.exists("fee_rate")) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "feeRate and fee_rate options should not both be set. Use fee_rate (feeRate is deprecated).");
}
auto fee_rate = options.exists("feeRate") ? options["feeRate"] : options["fee_rate"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK on moving away from feeRate

@jonatack
Copy link
Member

jonatack commented Oct 27, 2020

I agree this is more sane than currently, especially aliasing feeRate to fee_rate. Didn't test the commit "RPC/Wallet: sendtoaddress & sendmany: Accept fee_rate as an alternatve to conf_target"; not sure it works as-is but it would need test coverage.

@luke-jr
Copy link
Member Author

luke-jr commented Oct 28, 2020

Fixed review comments including adapting tests

@sipa
Copy link
Member

sipa commented Nov 4, 2020

Concept/approach ACK, also superficial code review ACK. Needs linter fix.

} else if (!estimate_param.isNull()) {
cc.m_confirm_target = ParseConfirmTarget(estimate_param, pwallet->chain().estimateMaxBlocks());
} else {
if (&conf_target_param != &fee_rate_param && !fee_rate_param.isNull()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to look this up as this is comparing pointers to unrelated objects, but my reading of https://en.cppreference.com/w/cpp/language/operator_comparison is that this is indeed well defined.

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 4, 2020

🐙 This pull request conflicts with the target branch and needs rebase.

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@@ -440,7 +451,7 @@ static RPCHelpMan sendtoaddress()
{"subtractfeefromamount", RPCArg::Type::BOOL, /* default */ "false", "The fee will be deducted from the amount being sent.\n"
"The recipient will receive less bitcoins than you enter in the amount field."},
{"replaceable", RPCArg::Type::BOOL, /* default */ "wallet default", "Allow this transaction to be replaced by a transaction with higher fees via BIP 125"},
{"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)"},
{"conf_target|fee_rate", RPCArg::Type::NUM, /* default */ "wallet default", "Confirmation target (in blocks), or fee rate (for " + CURRENCY_UNIT + "/kB or " + CURRENCY_ATOM + "/B estimate modes)"},
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this also be aliased to something? Like fee_rate_type?

@luke-jr
Copy link
Member Author

luke-jr commented Nov 6, 2020

Closing in favour of #20305

@luke-jr luke-jr closed this Nov 6, 2020
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants