Repository navigation
Description
Summary
Wallet unload during a worker's progress dialog is not deferred; a successfully signed PSBT is then discarded and reported as a signing failure.
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, #167.
Observed
Confidence: confirmed (proven from code) for the reachability of the unload. The discard is asserted by the existing test.
- Location:
src/qt/walletcontroller.cpp:205-214(unload is deferred only when the active modal widget is not aQProgressDialog),src/qt/psbtoperationsdialog.cpp:300-305. - Scenario: The upstream exemption for
QProgressDialog(c391858, meant for wallet-activity progress) now also covers qbit's new worker progress dialogs, which are application-modalQProgressDialogs.- PSBT:
qbit-cli unloadwalletwhile the PSBT signing progress dialog is shown makesremoveAndDeleteWalletrun at once. TheWalletModelis deleted (the PSBT dialog survives underWalletFrame), and the worker completes the signing.signTransactionFinishedthen reports "Failed to sign transaction: Wallet is no longer loaded." plus "The signing attempt failed after consuming PQC signature capacity", and keeps the original unsigned PSBT. Signing actually succeeded and the PSBT needs no wallet to be copied, saved or broadcast. Re-signing after a reload consumes fresh counters. - Fee bump: the same unload during the bump progress dialog makes
~WalletModeljoin the worker on the GUI thread (finishBumpFeeThread) for the remaining signing and commit, with no progress UI. - Send prepare: this already happened in v1.0.0 (
~SendCoinsDialogjoins).
- PSBT:
- Evidence: Code trace. The test only simulates the unload by
fixture.wallet_model.reset(). Not reproduced through WalletController.
Impact
A completed signing is misreported as a failure and a durable-capacity artifact is thrown away. walletUnloadDuringSigning (psbtoperationsdialogtests.cpp:397-414) asserts this discard behaviour, so the test locks it in.
Suggested fix
When !m_wallet_model at completion and the result is error-free, keep result->psbt (renderTransaction already handles a null model). Report "signed; the wallet was unloaded" with the Consumed outcome. Alternatively, defer unload while a PSBT, bump or send worker is active (narrow the QProgressDialog exemption to the activity dialogs, for example with an object name or a dedicated subclass check).
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) for PSBT signing. When the wallet is unloaded mid-signing, the dialog keeps and shows the signed PSBT and reports it as signed, with the usage block and "The wallet was unloaded while signing." Copy, Save and Broadcast stay available. The fee-bump and Send-preparation cases this issue also describes are tracked in #356.maingets the fix when1.x.xis integrated.qt: keep PSBT signing results across shutdown, close and unload (#344)