mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 08:12:38 +00:00
qml: Require a custom fee when fees cannot be estimated #1092
No reviewers
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml!1092
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/fallback-fee-unavailable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Without fee estimates and with
-fallbackfeedisabled (the default outside regtest), the Send preview made up a rate from the required fee times a per-preset multiplier, while transaction preparation used the confirmation target alone. Review showed a fee, and Core rejected the transaction only after the passphrase was entered. Remove the made-up preview rate so the preview follows the same fee policy as the final transaction. When the selected target has no estimate, show "Your node can't estimate fees yet. Choose Custom and enter a fee rate to continue." and keep Review disabled until a valid custom rate is entered. New blocks retry the estimate, so Review unlocks once the node can estimate.The availability check and the preview now share one prepared coin control per target, so they cannot diverge.
#1036 asks to either expose
fallbackfeeor recommend a custom fee. This takes the second option. Missing estimates are temporary, Core disablesfallbackfeeby default to avoid a fixed rate that ignores the network, and the Qt Widgets GUI never exposed it. It remains available inbitcoin.conf.A custom fee rate such as
18446744073709552.616sat/vB overflowedwhole_part * 1000 + fractional_valueinParseCustomFeeRatePerKvB()and became an unrelated rate. Check the bound before the arithmetic and reject the rate.Selecting the already-checked Custom option replaced the entered rate with an estimate. Only seed the rate from an estimate when switching to Custom from a preset; moving the target slider still updates it.
Unit tests cover the overflow bound and the unavailable-estimate reporting with fallback disabled and enabled. QML tests cover the Review gate, the block retry and reselecting Custom. Manually tested on a custom signet without fee history or
-fallbackfee: Standard keeps Review disabled with the new message; Custom at 17 sat/vB keeps its rate after reselecting Custom and sends at 17 sat/vB; after a few blocks of fee history, Review enables without editing the form and Standard sends at the estimated rate.Fixes #997
Fixes #1025
Fixes #1036
Fixes #1086
No verified findings are available from this review.
Review coverage was incomplete.
Reviewed:
ca075b1df770· Review reportI found a regtest case where the preset itself selects a rate below the node’s relay minimum. On merged
qt6ateed1f426fcb6, I started a funded wallet with-minrelaytxfee=0.00002(2 sat/vB) and entered a 0.1 BTC payment.Fee rate (1.000 sat/vB) is lower than the minimum fee rate setting (2.000 sat/vB).Reading the PR at
e22379e6f358, the regtest override still sets an explicit 1 sat/vB rate, andNetworkFeeEstimateUnavailable()returnsfalsewhen that rate is set. That appears to skip the new Custom-fee guidance for this case. Regtest override, availability check.Could the preset use at least the configured relay minimum? If a preset cannot produce a valid transaction, it would help to explain why and point to Custom before enabling Review.
@jarolrod Thanks, reproduced. The regtest override now uses at least the wallet's required fee rate (max of -mintxfee and -minrelaytxfee), so the presets produce a valid fee instead of falling below the minimum. With -minrelaytxfee=0.00002, Standard now opens Review and broadcasts at 2 sat/vB; the default profile stays at 1 sat/vB. Fixed in
09007d296ewith a unit test.@jarolrod could you take another look? The -minrelaytxfee case is fixed in
09007d296e