mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:42:38 +00:00
Send: importing a payment request for the same amount leaves Use maximum active #1121
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#1121
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?
After Use maximum, importing a payment request whose amount equals the amount already in the field leaves the recipient in maximum mode. The request's amount is then treated as "everything in the wallet": the fee is taken out of it, and it follows later fee and balance changes.
To reproduce at
eed1f426fcb6:2.00000000with Sending maximum available under it.bitcoin:<regtest address outside this wallet>?amount=2and click Apply.1.99997800, still marked Sending maximum available. No message is shown.2.49996460.Review shows 2.49996460 BTC to the recipient, a 0.00003540 BTC fee and Ready to send, for a request that asked for 2 BTC. Changing the fee from 20 to 10 sat/vB also moves the amount. I stopped at Review and sent nothing.
File → Open URI… and the address field's Use payment request clipboard action behave the same. The clipboard route shows no Confirm paste? prompt, because the amounts match and the form has no address or label for the request to conflict with.
Controls:
Amount plus fee exceeds available balance. After the 0.5 BTC arrives it reviews as 2.00000000 BTC plus a 0.00004160 BTC fee, with no all-funds warning.amount=1) after Use maximum: maximum mode is cleared and 1.00000000 is kept across a fee change.The import assigns the amount (SendCreate.qml#L624-L626), and maximum mode is cleared only by the amount's change signal (walletqmlmodel.cpp#L810-L813). Assigning an equal value emits no signal (bitcoinamount.cpp#L84), so the mode survives. Clearing maximum mode explicitly whenever an imported request carries an amount would cover it.
This is narrow and visible. The requested amount has to equal the prefilled maximum to the satoshi, and the changed amount is shown in the field, the warning and Review. Related to #1000 and #1048, but it needs neither a focus change nor a leftover confirmation.
Tested on macOS / Qt 6.9, isolated regtest, offscreen. The request text and the custom fee rate were set into their fields directly, the clipboard text was set through the test bridge, and File → Open URI… was triggered through its menu action; the other steps were clicks through the test bridge. The same amounts were recorded in a native window at
d567e3eb2497in October, pasting the request into the address field.