mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Keep fee replacement preparation, signing and commit off the GUI thread #976
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#976
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?
Parent: #925.
Opening a speed-up dialog can block while preparing a replacement transaction. Confirming can block again during security checks, signing, commit or external-device communication. Updating the visible state to Preparing or Committing does not offload those calls.
Cover
createBumpTransaction(),transactionCanBeBumped(), unlock/relock,signBumpTransaction()andcommitBumpTransaction(). Preparation can acquire wallet, chain and mempool locks; commit includes persistence and validation work.Run the complete operation outside the GUI thread and return fees, transaction identity, security state and errors without completion-time backend queries. Keep presentation getters cached. Reject obsolete preparation after the transaction or target changes, and prevent duplicate confirmation.
Recheck replaceability before commit. Once commit begins, closing the dialog must not imply cancellation or release resources still in use.
Acceptance should cover delayed preparation/signing, changed targets, repeated confirmation, wrong passwords, relock after failure, mined or replaced originals and close during work. Coordinate hardware helper behavior with #583 and wallet retirement with #577/#917.
Two concrete cases for the replacement failure/retry handling here:
The first case also occurs when the original confirms while the fee preview is open: Update transaction remains enabled and still opens the password prompt.
Core correctly refuses these replacements, and the wallet relocks. The GUI should retire an obsolete preview and stop offering password retries once the operation has entered a terminal failure. The detail action also needs to reflect changed replacement eligibility.
With the original transaction still eligible, an incorrect password followed by the correct one succeeds normally. No replacement was submitted in the failure cases.
Reproduced on
qt6at6e54a48ab571, macOS / Qt 6.9, using isolated offscreen regtest checks.An additional case for the stale-review work here: the original transaction can remain eligible for a fee bump while an input added to the prepared replacement starts funding a separate pending payment.
To reproduce:
The prepared replacement C is accepted and mined. It spends the inputs of both A and B, preserves A’s recipient, and omits B’s recipient. B receives zero confirmed credit; its value returns as sender change. In the matched Cancel control, both A and B confirm and B’s recipient receives 0.2 BTC. Spending X before opening Speed Up prevents preparation instead.
The current bump model already rechecks
transactionCanBeBumped(A). That check passes here because A itself remains eligible. The missing check concerns the additional conflicts acquired by the retained candidate while Review was open.Core permits multi-conflict replacement. The GUI should invalidate or require renewed review of a fee-bump approval when it would also replace a separate payment. Checking only the original transaction again does not establish that the approved replacement still has the same scope.
This adds an accepted-replacement case to the refusal and retry cases already discussed here. Reproduced with the full merged application at
6e54a48ab571, macOS / Qt 6.9, offscreen regtest. It requires a second client acting on the same wallet during the open review.An open Speed Up review also survives explicit abandonment of the original payment.
To reproduce:
abandontransactionfor the original.The wallet reports the original as abandoned. Activity changes to Cancelled and removes its Speed Up action, but the already-open review still permits Update.
In the reproduction, Update created a replacement that entered the mempool and confirmed, paying the recipient 0.125 BTC. Closing the review instead preserved abandonment and produced no replacement payment.
This requires a subsequent explicit Update click; abandonment itself does not trigger a payment. The inconsistency is that the retained review remains actionable after the wallet and transaction detail have retired that action.
QML should invalidate the prepared review when the original is abandoned and recheck this state before signing or committing. Core’s current fee-bump preconditions do not reject the abandonment flag.
Reproduced on merged
qt6at6e54a48ab571, macOS / Qt 6.9, using isolated offscreen regtest with accelerated mempool expiry and a second wallet client.