7 minor findings · 3 suggestions
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Findings
[minor] · Changing the password during a temporary worker unlock can leave the wallet unlocked
An untested interleaving between changeWalletPassphrase() and a worker's temporary relock can leave an encrypted wallet unlocked, allowing the next Send to proceed without a password prompt.
Location: qml/models/walletunlock.h:27 (head).
Details and suggested fix
changeWalletPassphrase() bypasses WalletUnlockSession, unlike worker signing, Receive unlocks and Send. In pinned Core, CWallet::ChangeWalletPassphrase() reads fWasLocked = IsLocked() before acquiring LOCK2(m_relock_mutex, cs_wallet). If it observes the worker's temporary unlock and the worker relocks before that LOCK2 is acquired, the password change subsequently unlocks the wallet but skips its final relock because fWasLocked is false. The worker's relock has already finished, so no guard remains to lock it again. Moving signing and Receive unlocks off the GUI thread introduces this overlap within the GUI workflow. Have changeWalletPassphrase() take the shared session with tryAcquire() and report the same recoverable busy error as Send. The source ordering permits this race, but its occurrence in practice is unconfirmed.
[minor] · An older save receipt can undo the following snapshot's payment reconciliation
If a payment arrives during an edit-save, the older saved_entry can clear the reconciled paid flag and re-enable QR sharing; this interleaving has not been exercised.
Location: qml/models/walletqmlmodel.cpp:810 (head).
Details and suggested fix
The Save branch captures result.saved_entry under cs_wallet, releases the lock, and then takes the final snapshot. That snapshot can observe a newly arrived payment and set payment_received to true. The completion applies the snapshot first, then reapplies the older receipt to the matching detailPaymentRequest. applySavedRequest() assigns the older false flag directly, and PaymentRequestCard.sharing consequently becomes eligible again after reconciliation settles. If the payment notification was already counted when the final read started, it does not request another refresh; unchanged unconfirmed payments also do not force one during polling. When a snapshot is available, apply its reconciled entry to matching request objects and use saved_entry only as the fallback for a failed refresh. Add a test that introduces a payment between the save and final read.
[minor] · A request metadata warning hides the successfully loaded wallet balance
If persisting a request's paid flag fails, walletStateError makes the badge report “Wallet information unavailable” despite a successfully loaded balance; this failure path was not exercised.
Location: qml/models/walletqmlmodel.cpp:709 (head).
Details and suggested fix
read() returns the loaded wallet data with persistence_error when setAddressReceiveRequest() fails to store an observed payment. applyWalletState() sets readiness to true but copies that warning into walletStateError. DesktopWallets.qml passes it to WalletBadge.qml, where any nonempty error hides the balance and selects the wallet-wide unavailable message. Subsequent snapshots retry the metadata write and reproduce the presentation while it keeps failing. Expose this persistence warning separately from failed wallet reads so the badge can retain the valid balance.
[minor] · Reopening a request during deletion leaves the deleted request displayed as saved
When the same request is reopened before deletion finishes, the opening guard leaves detailPaymentRequest intact, so the deleted request can remain on screen with sharing actions.
Location: qml/components/PaymentRequestCard.qml:258 (head).
Details and suggested fix
Start deleting request A, close its modal, and reopen A from Activity while the Remove command is pending. The cached list still permits loading A. On completion, the changed opening number routes the result through deletedInEarlierOpening, whose modal handler clears only currentPaymentRequest. The displayed object is detailPaymentRequest, and applyWalletState() leaves it unchanged when its entry is absent. Its nonempty ID therefore still satisfies saved, and an unpaid request can regain QR sharing even though editing it will fail as unavailable. Invalidate the matching detail request or show an unavailable state for this same-wallet, same-ID case, while preserving a newer opening of a different request. Update the existing same-request-reopened test, which currently asserts that the deleted ID remains displayed.
[minor] · isEncrypted stays stale after successful initial encryption
Reopening password settings after successful encryption but before the next snapshot can still select “Set password” mode and reject another submission to the already-encrypted wallet.
Location: qml/models/walletqmlmodel.cpp:2767 (head).
Details and suggested fix
encryptWallet() returns true after refreshSecurityState(), but that function now only requests an asynchronous snapshot rather than updating the cached security properties synchronously as at base. Successful initial encryption pops the password page. If it is reopened before that snapshot arrives, WalletSettingsStack.qml initializes updating from the still-false isEncrypted, so submission calls encryptWallet() again instead of changing the password. Apply the known encrypted and locked state immediately after successful encryption, using applySecurityState(), and still request reconciliation. The interval is short on an idle wallet but can extend while refresh scheduling waits behind pending work or retry backoff.
[minor] · Idle wallet polling recomputes balances that it does not use
Each successful idle poll scans wallet TXOs under cs_wallet through tryGetBalances() only to obtain the processed-block hash; the new one-second timer runs for every loaded wallet, with CPU impact unmeasured.
Location: qml/models/walletqmlmodel.cpp:610 (head).
Details and suggested fix
Base enabled its Receive poll only while request payments were unconfirmed. Head starts the timer for every wallet, and poll() calls tryGetBalances() before comparing the processed-block hash. In pinned Core that call runs GetBalance() over every wallet TXO while holding cs_wallet, even when the hash is unchanged and no snapshot is needed. Core's Qt wallet model avoids this calculation until a notification or tip change requires it. Gate the expensive query on a cheaper tip or notification check, retaining retries until wallet processing catches up and keeping independent checks for notification-free lockunspent changes. This removes recurring work proportional to wallet history without sacrificing the reasons for polling.
[minor] · A busy wallet makes a label edit report that the address is unavailable
setAddressLabel() now rejects edits while another Receive command is pending, but the Address details editor reports that rejection as “This address is no longer available.”
Location: qml/pages/wallet/AddressList.qml:89 (head).
Details and suggested fix
setAddressLabel() submits a Label command, and canSubmitReceiveCommand() rejects it while a request save, delete or other Receive command is pending. AddressListModel forwards false unchanged. The details note field remains editable because it only checks labelChangePending, and onEditLabelRequested maps every false result to the unavailable-address message. This gives the user the wrong recovery advice for an address that still exists. Detect receiveOperationPending in this path and report that the wallet is saving another change and the edit can be retried.
Optional improvements
[suggestion] · Lightweight Receive commands perform an unnecessary full pre-read
Label, Remove, AddressType and RememberAddress normally perform two full wallet scans even though their writes need much less data than Save and EnsureAddress.
Location: qml/models/walletstatesnapshot.cpp:305 (head).
Details and suggested fix
execute() calls read(node) before dispatching every command, then calls it again through complete() and finish(). Each read enumerates addresses, coins, requests and wallet transactions, including payment reconciliation. The RememberAddress branch needs none of that pre-read data; Label and Remove need only the saved requests; AddressType needs the capability and preference checks. Skip the unused pre-read or replace it with those narrower queries, preserving address-type defaults and the final snapshot reconciliation. Keep the consistent pre-read for Save and EnsureAddress. This reduces work in the serial wallet queue and the time commands remain pending without changing their results.
[suggestion] · An unknown selected-coin balance is presented as insufficient funds
While a sufficiently funded selection awaits its balance query, Send treats its balance as zero and can show an insufficient-inputs error instead of a pending state.
Location: qml/models/walletqmlmodel.cpp:2606 (head).
Details and suggested fix
refreshSelectedAvailableBalance(true) clears the cached selected balance and queues its replacement on the wallet executor. Until completion, sendAvailableBalance() returns zero, so sendAmountExhaustsBalance() can produce “Selected inputs do not cover the amount plus fee.” The gross maximum-recipient remainder also becomes zero when its destination is empty. This is deliberately conservative, but the message classifies unknown funds as insufficient and can remain while earlier wallet work occupies the queue. Expose a selected-balance pending state, disable Review while it is pending, and leave the maximum amount unset rather than presenting zero. The visible duration has not been measured.
[suggestion] · Failed batch coin-lock operations discard the marked selection
As at base, a failed batch coin-lock operation loses the marked selection, so retrying requires selecting every coin again; asynchronous acceptance still clears the marks before the outcome arrives.
Location: qml/components/CoinsList.qml:64 (head).
Details and suggested fix
CoinsList.lockMarked() clears markedIds when setCoinsLocked() returns true, which now means the operation was accepted rather than completed successfully. A later lockOperationError is displayed but does not restore the batch. failedWritesReconcileAndCanBeRetried() covers an accepted failure followed by retry with the same IDs; it also shows that a failed persistence write can already have changed the in-memory lock state. Retain the submitted marks until successful completion so the user can retry persistence without manually selecting the batch again. This improves existing recovery behavior rather than fixing a regression.
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)
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
Explicit task outcomes originated in a lifecycle problem, not just an API preference: a submission rejected during shutdown or a cleared completion could leave model pending flags permanently set. The historical proposal also identified missing request identity, cancellation and replayable drain observation. The subsequent executor proposal preserved worker-side cleanup and shutdown draining while adding explicit outcomes.
These constraints explain the task-outcome dependency included in this patch and its migration of wallet operations. They distinguish settling GUI state from releasing backend captures: cancellation notification and actual worker cleanup need not occur simultaneously.
QR export has a distinct failure boundary from successful request persistence or image readiness. The historical oversized-request report described an encoder failure represented as a transparent image that QML accepted as ready, allowing a blank export without an error.
This explains why the affected behavior exposes encodability and separates QR actions from copying the complete request. Merely moving the file write to a worker does not answer whether the captured image represents a usable payment code.
Unresolved disagreements
The inspected historical discussion leaves an architectural tradeoff between worker-side polling/querying and pushing sufficiently complete state from backend notifications. Participants supported asynchronous execution but warned that it can replace freezing with loading delays while leaving redundant work intact; a worker-to-GUI helper was also presented as an incremental remedy for known hangs.
The patch's snapshots and selective polling sit within this tradeoff. The inspected record does not establish that worker execution alone resolves efficiency concerns, nor does it establish a settled requirement to eliminate all polling.