mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Send: Leaving an untouched amount field can cancel Use maximum #1000
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#1000
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
I reproduced Use maximum reverting to an older amount after the wallet's balance changed. Clicking away from the amount field was enough; I didn't edit it.
To reproduce:
qml_test_psbt.build_fixtures. Selectpsbt-source, which initially has 50 BTC spendable.psbt-review-onlyis funded separately.psbt-sourcefrompsbt-review-only, then mine one block to the funding wallet. In this fixture, another 50 BTC reward also matures inpsbt-source.The balance reached 100.5 BTC, but the focused field retained
49.99999890. The refreshed draft used100.49999755. Clicking Note wrote the old field value back into the draft and disabled maximum mode. Selecting Use maximum again recovered.An untouched field should not overwrite the refreshed amount or turn send-all into a fixed payment when it loses focus. We should also keep deliberate amount edits working normally.
Tested on
qt6at09c6de77d7f36bf7fa07c354ebeea51105c447a3, macOS arm64, Qt 6.9.0. I used the unchanged application with native mouse clicks for focus and blur, and checked the balances through RPC. No transaction was broadcast by this reproduction.This differs from #996: the refreshed draft is valid here, but stale field text overwrites it.
There is a complementary amount-edit case to cover here: a deliberate replacement can be discarded while Use maximum remains active.
On
qt6atd567e3eb2497, macOS / Qt 6.9.0:53.76000000BTC.lockunspent. The available balance becomes 53.75 BTC, but the amount field still shows 53.76 BTC.0.01234567.53.75000000and still says Sending maximum available. The replacement amount has been discarded.Entering a destination afterwards keeps maximum mode active. Review still presents Use all available funds? and then shows the full payment, less the fee. No transaction was broadcast. Replacing the amount a second time works, and entering a destination before the same sequence preserves the edit correctly.
A coinbase maturing while the displayed maximum remains stale produced the same result. The balance-refresh gaps are related to #995 and #996, but the edit handling is a separate part of the problem.
In the GUI wallet model,
scheduleFeeEstimates()refills the maximum from the current available balance when there is no destination. That refill runs underm_updating_maximum, before the amount-change handler can clear maximum mode for the user's edit. Core supplies the updated balance; the GUI model overwrites the edit and retains maximum mode.A genuine amount edit should leave maximum mode before an automatic refill can replace it. Together with the original report, this needs both behaviors preserved: an untouched field must not cancel maximum mode, and a deliberate edit must cancel it and retain the entered amount.
The reproduction replaced the whole field through the test bridge in the native Cocoa GUI, emitting the edit signals. It did not establish the behavior of typing individual digits through the keyboard.