4 minor findings · 3 suggestions
Earlier concerns neither republished nor resolved: 2 suggestions. See the Run archive for their assessments.
Findings
[minor] · Send can still spend a coin while its lock is pending
Before an asynchronous coin lock completes, Send can prepare a transaction using the still-selected coin; this latency-dependent window has not been observed in use.
Location: qml/models/walletqmlmodel.cpp:2501 (head).
Details and suggested fix
Select a coin in Send, lock it from the wallet’s Coins view, then return to Send before the worker finishes. Previously, locking synchronously removed the coin from the draft. Now setCoinsLocked() unselects it only after the worker applies the lock and reads a full snapshot. Submission invalidates neither the fee preview nor the selected balance, and neither Review nor prepareTransactionInternal() checks m_coin_lock_pending. Pinned Core’s FetchSelectedInputs() accepts explicitly selected locked coins, including when calculating the available balance. Completion later changes the selection but leaves the prepared transaction intact. Sending still requires normal review and confirmation. Disable Review and reject preparation while a coin lock is pending.
[minor] · Message signing races first-time wallet encryption
A queued signing task can read isCrypted() concurrently with GUI-thread wallet encryption, creating a C++ data race on Core’s master-key map.
Location: qml/models/signverifymessagemodel.cpp:76 (head).
Details and suggested fix
signMessageInternal() now reads isCrypted() on the shared wallet worker, including before acquiring the unlock session. In pinned Core, this calls HasEncryptionKeys(), which reads mapMasterKeys.empty() without locking. EncryptWallet() inserts into that map under cs_wallet, but GUI-thread WalletQmlModel::encryptWallet() neither acquires the session nor waits for signing. A user can leave the signing page while its task is queued and open password settings. Page destruction only advances the generation, so it discards the eventual UI result without cancelling the read. Both GUI operations were synchronous at base. Read security state through a locked helper such as ReadSecurityState(), releasing cs_wallet before waiting for the unlock session or unlocking. Add coverage for queued signing overlapping first-time encryption.
[minor] · Unrelated wallet snapshots invalidate Send fee previews
For a valid Send draft, every applied snapshot clears the fee preview and disables Review, even without fee-relevant changes; sustained refreshes can prolong this state, though its duration is unmeasured.
Location: qml/models/walletqmlmodel.cpp:734 (head).
Details and suggested fix
applyWalletState() unconditionally calls scheduleFeeEstimates(). That clears the estimates, sets feeEstimatePending and restarts the debounce, while Review requires the flag to be false. This also happens after label and Receive commands unrelated to the Send draft. Estimates share the serial worker with snapshot reads, and an estimate whose outcome arrives after a newer snapshot is discarded by request ID. Polling avoids full reads when nothing changes, but does not prevent this invalidation whenever a snapshot is applied. Retain the previous preview and keep Review available while refreshing an unchanged draft in the background; preparation already recomputes the transaction before presenting it for review.
[minor] · A busy unlock session leaves fee-bump review stuck in Failed
If an encrypted wallet’s unlock session is busy, fee-bump confirmation enters Failed and cannot retry within the same overlay, despite telling the user to try again.
Location: qml/models/bumptransactionmodel.cpp:160 (head).
Details and suggested fix
Signing and Receive operations can hold the shared unlock session when confirmFeeBumpInternal() tries to acquire it. The new busy-session branch calls setError(), which moves the model to Failed. Confirmation accepts only NeedsConfirmation, and SpeedUpOverlay enables Update transaction only in that state. A passphrase-popup resubmission also fails the model’s state check. The user must close and reopen the overlay to prepare it again. Display the temporary busy error without leaving NeedsConfirmation, while preserving the existing eligibility recheck before signing.
Optional improvements
[suggestion] · Light Receive commands perform an unnecessary full wallet scan
Label, Remove, AddressType and RememberAddress each perform a full wallet read before execution and another afterward, although they use little or none of the first snapshot.
Location: qml/models/walletstatesnapshot.cpp:328 (head).
Details and suggested fix
execute() calls read(node) before every command, then calls it again through finish() to publish the result. Each read collects balances, addresses, coins and requests, and walks the wallet transaction history. Label and Remove need only the request entries from the first snapshot, AddressType needs capability flags, and RememberAddress needs none of it. This extra scan occupies the same serial worker as fee estimates and refreshes, including for inline label edits. Use targeted validation reads for these commands while retaining the final publishing read and its separate refresh-error handling. Keep the locked validation read for Save and EnsureAddress. No timings were measured.
[suggestion] · The settings test wallet exposes a different completion contract
The QML test wallet completes encryption, passphrase changes and backups on a later event-loop turn, unlike production methods whose returned boolean reports the completed operation.
Location: test/qml/qml_tests_main.cpp:1706 (head).
Details and suggested fix
The fixture’s encryptWallet() and changeWalletPassphrase() return acceptance from startSettingsOperation(), and backupWallet() similarly defers its effects with QTimer::singleShot(). Production returns the finished result synchronously. WalletPasswordSettings immediately passes that boolean to handleSaveResult(), so under the fixture it can report success before the simulated operation completes. No QML consumer observes settingsOperationFinished, and the automatic completion always supplies success. Keep these fixture methods synchronous and provide a configurable success or failure result so page assertions use the same result boundary as production.
[suggestion] · Batch-lock failures discard the marked coins
As at base, a failed batch lock leaves nothing marked; the asynchronous implementation clears markedIds on submission, forcing users to reselect the coins before following its retry message.
Location: qml/components/CoinsList.qml:64 (head).
Details and suggested fix
setCoinsLocked() returning true now means the command was accepted, not that every lock succeeded. lockMarked() clears markedIds immediately, while database-write failures or snapshot-read exceptions are reported later through lockOperationError. A failed write can also change the in-memory lock state. Keep the submitted marks until completion and clear them only on success, retaining the existing wallet-change cleanup. This would preserve the batch for retry without changing successful behavior.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Unused label aliases contradict their documented contracts (earlier report)
- [suggestion]: The wallet-refactor commit adds an unexplained QML package (earlier report)
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
Keeping wallet queries out of GUI getters is a responsiveness boundary: apparently simple balance, capability and metadata reads can acquire backend locks or scan wallet outputs. Caching also avoids repeating those calculations across views.
Issue #968 explicitly calls for cached getters, bounded refresh work and completion callbacks that only apply results. At the comparison base, the balance getters call the wallet directly. The pinned Core implementation locks cs_wallet for available-balance queries and wallet scans, while its existing Qt model documents cached balances and retry-on-busy polling to avoid freezing during rescans. This explains the snapshot/worker direction without establishing that every changed path satisfies it.
Moving an operation to a worker must preserve the identity of the wallet, request, draft and dialog opening that initiated it. Successful persistence and presentation of its result are separate concerns.
Issue #972 requires successful changes to remain associated with the original wallet after switching away, while late results must not clear newer drafts, close reopened dialogs or appear over another wallet. It also identifies request-ID collisions across wallets and unload as relevant cases. These requirements explain the changed opening counters, wallet-qualified completions and visibility checks in the Receive workflow.
An asynchronous executor needs an explicit request lifecycle, not merely a best-effort callback: rejection, cancellation and shutdown must let live receivers settle pending state, while cleanup and draining have defined lifetimes.
Issue #1054 explains that missing callbacks could leave model pending flags stuck, boolean submission results provided no cancellation identity, and a one-time drained signal could be missed. The narrower #1109 proposal preserves worker-side cleanup and draining while adding outcomes and replayable drain observation. The head executor contract distinguishes queued cancellation from optional discarding of running results and does not interrupt running work. That distinction matters for wallet writes that may already have taken effect.
Encrypted-wallet operations can require unlock state to remain valid for an entire operation, not just one locked method call. Historical Core work introduced separate relock coordination because a timeout or another operation could remove the passphrase while a rescan still needed it.
The rationale in Core #26347 is specifically about rescans and keypool top-ups; it is not proof that the QML session mechanism is correct. It supplies a relevant precedent for the lifetime problem introduced when Receive and message signing overlap other wallet actions. Separately, the pinned Qt UnlockContext records whether the wallet was originally locked and restores that state on destruction, explaining the expectation that a temporary unlock should not become a permanent one.
A payment request's current received amount and its permanent record of having observed a payment serve different purposes. A replacement paying elsewhere can remove the current payment without making the address suitable for reuse again.
Issue #1042 explicitly distinguishes the current payment badge from the historical sharing/reuse restriction. The base already excludes inactive, abandoned or replaced-away unconfirmed payments from totals while retaining observation history. The head snapshot preserves that separation. This explains why changing the badge must not simply clear the permanent observed-payment flag.
Receive-address reuse has historically involved a privacy-versus-usability tradeoff, rather than a protocol prohibition. Request history reduced the need to reuse an address merely to resend an invoice, but users also wanted QR codes for older addresses; HD-wallet availability and maintenance of rarely tested legacy branches affected the discussion.
Core #3716 records both the motivation for removing the reuse option and objections concerning older-address QR access and non-HD wallets. This history explains why the affected QML code distinguishes reopening an existing request from allocating an address to a new request, and why reuse restrictions are product policy rather than consensus rules. It does not establish that every present sharing restriction follows directly from that older decision.
Source 1 · Source 2 · Source 3 · Source 4 · Source 5
Background export must preserve a consistent user-selected view, and moving only the final file write is insufficient if collecting or formatting rows still blocks GUI event processing.
Issue #969 explicitly requires filter and activity changes not to mix unrelated views in one CSV, collection as well as file work to avoid stalling the GUI, and closure not to invalidate running work. Issue #972 draws a related boundary for QR saving: Qt image capture remains on its required thread, while encoding and file work move away. These are the historical constraints behind the affected export paths, not evidence of their present correctness.
Ralph's inferences
Notifications are best treated as refresh hints rather than a complete, authoritative stream of wallet state. Selective polling provides eventual reconciliation, at the cost of some delayed visibility and background work.
The head backend explicitly checks the wallet's processed tip, coin locks and outstanding unconfirmed payments. Its comments identify maturity, RPC coin locks and receiving-wallet mempool eviction as cases not fully covered by notifications. Polling only outstanding payment status also avoids rebuilding unchanged models and destroying inline editors. This explains the combination of coalesced notifications and polling rather than either mechanism alone.
A returned command result must distinguish persistence success from refresh success; otherwise retrying after a failed refresh can repeat a write that already succeeded.
The head Receive backend retains the saved request and ID when its follow-up snapshot read fails, explicitly to prevent a refresh retry from creating another request. This is an operation-level consistency tradeoff: stale displayed state can be recoverable without pretending that the preceding write failed.