Repository navigation
Description
Summary
The PSBT dialog can be closed while signing, which blocks the GUI thread for the rest of the signing and silently discards the signed PSBT and its usage report.
Severity: low. Found in the 2026-11-04 review of the v1.0.1 change set (all 1.x.x merges since v1.0.0 plus the open PRs that target it), against 1.x.x 21fee6ee8e; area: #145.
Observed
Confidence: plausible (reasoned; narrow timing for the P2MR case).
-
Location:
src/qt/psbtoperationsdialog.cpp:87(Close is never disabled;setSigningControlsEnabled(false)at :377-387 disables only copy/save/sign/broadcast), :93-104 (destructor joins the worker), :346-364 (the non-reserved Cancel branch does not re-show the progress dialog). There is noreject()/closeEvent()override inpsbtoperationsdialog.h. -
Scenario: The application-modal progress dialog appears only after 250 ms (:176-180). Qt's default
canceled()→cancel()connection hides it on Cancel, and only the counters-reserved branch callsshow()again (:354). So the PSBT dialog accepts Close, Esc or the window-manager close in two cases:- During the first 250 ms after Sign. By then provider collection and the first counter reservation are usually done.
- After Cancel, when the worker raced past the pre-reservation check (
wallet.cpp:2962) intoSignPSBTInput. Cancel is not atomic with the reservation, unlike the fee-bump CAS. For an external-signer wallet, Cancel is accepted during the device interaction because no counters are involved.
Closing deletes the dialog (WA_DeleteOnClose via
ShowModalDialogAsynchronously).~PSBTOperationsDialogthenwait()s on the GUI thread until the signing finishes or the external signer returns, with no progress UI. The completed PSBT andpqc_usageare destroyed unseen. The progress events after a raced cancel also update a hidden dialog, so the user sees nothing for the remaining signing. -
Evidence: Code trace. Qt documents that
QProgressDialog::cancel()"becomes hidden" and thatcanceled()is connected tocancel()by default. Not reproduced.dialogDestructionBeforeCompletiontests destruction only before reservation (allow_psbt_reservation=false).
Impact
The application looks hung for up to the signing duration. Stateful PQC capacity is consumed with no report. Compare AskPassphraseDialog, which ignores reject while encrypting (askpassphrasedialog.cpp:258-262 in #178).
Suggested fix
Override reject()/closeEvent() to ignore requests while m_sign_thread is set. Keep the progress dialog visible after a non-reserved Cancel (call show() as the reserved branch does) until the worker reports. Add a test that closes the dialog after reservation.
Activity
qt: keep PSBT signing results across shutdown, close and unload
qt: keep PSBT signing results across shutdown, close and unload (#344)
kiwidream commentedon Nov 6, 2026
Fixed on
1.x.xby #344 (merged as b5486bf). While the worker runs,reject()andcloseEvent()are ignored, so Close, Escape and the window manager can no longer close the dialog. A Cancel before reservation shows the progress dialog again until the worker reports, and the progress dialog ignores Escape once Cancel is gone. Covered bycloseIgnoredWhileSigningandcanceledProgressStaysVisibleUntilWorkerReports.maingets the fix when1.x.xis integrated.qt: keep PSBT signing results across shutdown, close and unload (#344)