mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:42:38 +00:00
qml: Move wallet overview, activity, address and receive work off the GUI thread #1146
No reviewers
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!1146
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/wallet-work-off-gui-thread"
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?
Replaces #990. @johnny9 agreed to hand it over; his five commits keep their authorship, and the rest of this PR rebases them onto current
qt6, addresses the open review comments and adds the fixes found while testing.Depends on #1109. This targets
qt6, so the diff includes the three #1109 commits until it is merged. It no longer depends on #985: the wallet commits only shared registration lines with it.Wallet balance queries, address scans, receive commands, payment reconciliation, message signing, CSV exports and QR file saves could block the GUI while waiting on
cs_wallet,cs_mainor the disk. A per-wallet backend builds a snapshot of the wallet state on the wallet's worker. GUI getters read that snapshot, refresh requests are coalesced, and stale replies are dropped. Labels, request saves and deletes, address preparation and coin locks run as commands on the same worker.On top of #990:
submitTask()from #1109, so each one reports exactly one outcome. Closing a wallet with work in flight no longer leaves pending states set, and a superseded fee estimate is cancelled before it runs.lockunspent, which emit no wallet notification.cs_walletinstead of twice, and releases it before writing settings. The notification from a command's own write no longer triggers another full read, and a failed read is retried after a growing delay.This does not fix #1116 or #1119. Every applied snapshot still resets the Addresses and Coins lists, which those issues track.
Unit, QML and functional tests cover the new cases, and each commit builds and passes the unit and QML suites. Manually tested on regtest with a password-protected wallet: requests, unconfirmed and replaced payments, inline labels while a payment is unconfirmed, coin selection and coin locks made over RPC, message signing and verification, CSV export, a request too long for a QR code, and closing a wallet while a save waits behind
keypoolrefill.Fixes #968
Fixes #969
Fixes #971
Fixes #972
Fixes #1042
7 additional verified findings in the Review report.
Earlier concerns neither republished nor resolved: 1 minor finding · 2 suggestions. See the Run archive linked from the Review report for their assessments.
🟠 Minor · Signing reads encryption state without synchronization
On an initially unencrypted wallet, background signing can race with GUI encryption because its
isCrypted()calls read Core's master-key map withoutcs_wallet.Location: qml/models/signverifymessagemodel.cpp:76 (head).
🟠 Minor · Send can use a selected coin while its lock is pending
Locking a manually selected Send input now leaves it selected until worker completion, allowing Review to prepare and sign a transaction containing that coin in the meantime.
Location: qml/components/CoinsList.qml:62 (head).
🟠 Minor · A busy unlock session makes the fee bump impossible to retry
The transient busy path moves
BumpTransactionModeltoFailed, disabling Update and rejecting password resubmission until the overlay is closed and reopened.Location: qml/models/bumptransactionmodel.cpp:160 (head).
🟠 Minor ·
lockunspentcan leave the cached Send balance staleAn RPC lock change between the balance read and lock-set checkpoint can leave Send using the old available balance until another refresh trigger; this interleaving was not reproduced.
Location: qml/models/walletstatesnapshot.cpp:142 (head).
🟠 Minor · Delayed signing opens its password prompt over Verify mode
Switching to Verify while signing is pending can bring up “Unlock and sign” over the Verify form, although submission still signs the previously submitted Sign-tab message.
Location: qml/pages/wallet/SignVerifyMessage.qml:84 (head).
🟠 Minor · A pending verification retains the previous result banner
Although edits already retained the previous banner, asynchronous submission now also leaves it beside the newly submitted inputs until verification completes.
Location: qml/pages/wallet/SignVerifyMessage.qml:76 (head).
Review coverage was incomplete.
Reviewed:
82f801e1302e· Review reportTested ACK
b993e67I ran into two non-blocking issues while testing Send and CSV export on Windows on Regtest.
After the node evicted a low-fee outgoing payment from its mempool, the wallet could no longer spend the change. Its spendable balance was zero, but entering 0.25 BTC in Send showed no warning and the "Review transaction" button stayed enabled. Clicking it correctly reported insufficient funds. Before this PR, the amount field showed the warning as soon as the amount was entered.
In a test wallet with about 25,000 transactions, a payment arrived while Activity was preparing a CSV export. The export was cancelled. With Activity still open, the app showed "Export failed" and prompted me to try again. In the run where the test switched to Send before the export finished, no CSV was written and no message appeared on returning to Activity. It would be helpful to see the retry prompt when coming back to that tab.