1 major finding · 8 minor findings · 4 suggestions
Findings
[major] · A recovery-scan exception leaves a dangling abort callback
A wallet database write failure during recovery can leave an abort callback referring to a destroyed local variable, which closing the wallet or quitting subsequently invokes.
Location: qml/walletqmlcontroller.cpp:155 (head).
Details and suggested fix
ResumeImport attaches [&wallet] { wallet->Scanner().Abort(); }, capturing its local shared_ptr by reference, but calls control.detach() only after a normal scan return. The pinned Scan calls SyncTransaction, which throws when a transaction write fails. Unwinding destroys the local shared_ptr. BackendExecutor catches the exception and skips the normal completion, so the entry remains in m_import_rescans with its callback attached. Both wallet closure and shutdown call cancel() on that control and dereference the destroyed stack variable, causing undefined behavior and potentially a crash. Install scope-bound detachment immediately after a successful attachment, and give the recovery task a failure handler that removes its control while retaining the pending marker.
[minor] · Quitting during the import discards a recoverable wallet
Quitting during the initial rescan deletes the new view-only wallet and its recovery marker, although the recovery path could finish it on the next launch.
Location: qml/walletqmlcontroller.cpp:860 (head).
Details and suggested fix
Shutdown interrupts the node before draining the wallet controller. When the import rescan returns, the shutdownRequested() check returns an error, and createWalletAsync calls DiscardCreatedWallet and clears the marker. The error arrives after shutdown has disabled the window, so the next launch gives no explanation for the missing wallet. This discards work from an operation the form says can take hours. For shutdown during the rescan, preserve the successfully installed wallet and its pending marker so recovery can finish it. Keep explicit cancellation and actual import errors separate. If deletion remains the intended shutdown behavior, persist an explanation for the next launch.
[minor] · Editing during an import hides the cancellation control
Typing in the name or descriptor field during an import hides Cancel import while the worker continues and Back and Close remain unavailable.
Location: qml/pages/wallet/CreateWalletForm.qml:111 (head).
Details and suggested fix
Both inputs remain editable, and their onTextEdited handlers call clearWalletLoadStatus(). That sets walletLoadInProgress to false without cancelling the worker. The new importRunning binding consequently becomes false and removes Cancel import, while creating remains true and continues to hide Back and Close. Editing descriptors also changes the preview even though the worker uses the input captured at submission. Disable the import inputs while creating so edits cannot reset the operation flag or replace the displayed import details. The clear-on-edit handlers existed before this PR, but the cancellation control now depends on the flag they reset.
[minor] · Recovery has no visible pending or failed state
Recovery opens the wallet without explaining incomplete history or reporting scan failures; persistent failures retry silently on each load, although no current production trigger was identified.
Location: qml/walletqmlcontroller.cpp:542 (head).
Details and suggested fix
resumeInterruptedImport uses the result only to decide whether to clear the marker. Its GUI completion merely erases the control, and no recovery progress is connected to the UI. Consequently, the wallet appears open while its history is still being recovered. If required block data became unavailable after the interruption, Scan returns FAILURE, but the wallet receives no explanation and silently retries on its next load. Expose a pending and failed recovery state on the affected wallet, with progress and an explicit retry action, so users can distinguish incomplete history from a completed import.
[minor] · Recovery uses wall-clock time for "now" imports
After a crash during an all-"now" JSON import, recovery can start later than the original scan because its marker uses wall-clock time instead of Core's tip MTP.
Location: qml/walletqmlcontroller.cpp:829 (head).
Details and suggested fix
ParseJson leaves "now" timestamps unset. createWatchOnlyWallet therefore saves QDateTime::currentSecsSinceEpoch() as the recovery start, whereas the pinned importer resolves unset timestamps against the tip's median time past. When MTP is earlier, recovery can skip blocks that the interrupted scan intended to inspect. On a sufficiently lagging chain, its start-block lookup can find nothing, and recovery clears the marker without scanning. Resolve "now" against the chain before journaling it, or persist a conservative start that is never later than Core's. The existing recovery test manually writes marker 0, so it does not exercise this mismatch.
[minor] · Same-named wallets share a recovery marker across directories
Same-named wallets in different same-network data or wallet directories share a recovery marker, so finishing one can suppress the other's recovery; production occurrence is unconfirmed.
Location: qml/walletqmlcontroller.cpp:128 (head).
Details and suggested fix
PendingImportKey hex-encodes only the wallet name and stores it in default QSettings, whose application namespace is selected per network. If an import of wallet A crashes, opening same-named wallet B under another -datadir or -walletdir reads A's marker. B receives an unnecessary rescan and clears that marker if it succeeds. Returning to A then leaves its interrupted history scan unfinished. Store the marker with the wallet, or include its canonical wallet path in the key, so recovery belongs to the wallet rather than its display name.
[minor] · Partially replaced multipath descriptors appear fully active
The preview shows a multipath descriptor as active for receive and change even when a later descriptor replaced one branch; watch coverage itself is unaffected.
Location: qml/viewonlyimport.cpp:480 (head).
Details and suggested fix
For descriptor lines wpkh(A/<0;1>/*) followed by wpkh(B/0/*), Core makes B the active receive descriptor and retains A only for change. DescribeViewOnlyImport initially records those separate slots, but reduces them to one active flag per request. A remains active through its change slot, and row construction still marks both receive and change, so its row has no Not active pill beside the replaced receive branch. Track activity per branch and split partially active multipath rows so the preview identifies which key will supply new addresses.
[minor] · BIP48 cosigner origins are treated as single-key imports
A BIP48 cosigner xpub with its origin is offered single-key address types instead of the multisig rejection; no concrete user input producing this case was identified.
Location: qml/viewonlyimport.cpp:323 (head).
Details and suggested fix
ReadExtendedKey detects multisig only through version bytes, and ORIGIN_PURPOSE recognizes only purposes 44, 49, 84 and 86. A valid [d34db33f/48h/0h/0h/2h]xpub… therefore reaches the address-type picker. Choosing SegWit wraps it as wpkh(.../<0;1>/*), which watches single-key addresses rather than the multisig wallet's addresses. Recognize multisig purposes 48 and 45 in the origin and use the existing multisig rejection message. This would intentionally reject nonstandard single-key uses of those purposes; it does not establish whether a particular signer would sign the resulting single-key scripts.
[minor] · next_index without range bypasses pre-import bounds checking
Hand-written JSON can pass validation with an out-of-range next_index, waste a rescan, then be discarded; no current input producing this case was identified.
Location: qml/viewonlyimport.cpp:225 (head).
Details and suggested fix
For a ranged descriptor with next_index but no range, ParseJson checks only the lower bound. Core instead uses m_keypool_size as the exclusive range end and rejects an index at or above it. If another request in the batch succeeds, Core still rescans before returning that error. The GUI then discards the entire new wallet, potentially after a long wait. Reject next_index without an explicit range, or validate against the actual default keypool range before creation. This does not affect ordinary listdescriptors output, which includes ranges for ranged descriptors.
Optional improvements
[suggestion] · Recovery cannot distinguish partial installation from a pending scan
The incomplete-installation crash risk predates this PR, but the new timestamp-only recovery marker can be cleared after rescanning a wallet whose requested descriptors were never fully installed.
Location: qml/walletqmlcontroller.cpp:844 (head).
Details and suggested fix
The setup lambda writes its marker before importDescriptors. Core then persists each request and each multipath branch separately, so a crash during installation can leave a blank wallet or only some requested descriptors. ResumeImport merely scans whatever exists and clears the marker on success; it cannot establish that installation finished. The installation window is shorter than the rescan, and the old code also wrote descriptors separately, so this is not a regression. Record an installation phase durably so recovery can flag an incomplete import instead of treating it as rescan-only. The functional recovery test starts with every descriptor already installed.
[suggestion] · Each interrupted recovery repeats the scan from its original start
The recovery marker never advances, so repeated sessions can redo the same whole-chain background scan despite Core saving scan progress.
Location: qml/walletqmlcontroller.cpp:161 (head).
Details and suggested fix
ResumeImport always derives its start block from the original marker, which is only removed after success. With save_progress=true, Core saves a scanned-block locator periodically, and AttachChain uses that locator for load-time synchronization. However, the GUI subsequently starts recovery from the original birth time again. Sessions shorter than a whole-chain scan therefore repeat substantial work while holding the rescan reservation. On USER_ABORT, persist a conservative checkpoint based on the last scanned block's time minus the timestamp window, provided no earlier block read failed. Keep the original start when failures require revisiting older blocks, and clarify that the existing comment describes load-time synchronization rather than the GUI recovery start.
[suggestion] · Pruning preflight is immediately revised by the next commit
Combining the adjacent pruning-preflight and dated-input explanation commits would let reviewers validate the complete preflight behavior and its tests together.
Location: qml/walletqmlcontroller.cpp:711 at 03c862c04e98 (commit) (commit).
Details and suggested fix
9cb5ca5322028c79e51ad9e932f9952ad58a183e introduces the in-setup pruning check. 65c6b317740576d6fc5a45a9a5ae9b330bab13d2 moves it before wallet creation and changes it to use the chain's prune height. The immediately following 03c862c04e985632c67b3c54450cc1e5f54e18d6 revises the same helper and caller to distinguish descriptor timestamps from the chosen date, replacing advice that cannot help dated JSON. Fold the latter commit and its functional-test additions into 65c6b317740576d6fc5a45a9a5ae9b330bab13d2. This keeps the final tree and dependencies intact while avoiding a separate review of the immediately superseded preflight behavior. The final-tree handling is not defective.
[suggestion] · Parser and row-grouping corrections are separated from their introductions
Folding these same-series corrections into their introducing commits would make the parser and row-preview invariants reviewable without first reviewing behavior that later commits replace.
Location: qml/viewonlyimport.cpp:469 at 3adce006f87a (commit) (commit).
Details and suggested fix
Fold 0b7dd5c3567d284565deafa8f4fc91bef57ddc1e, including its tests, into 9cb5ca5322028c79e51ad9e932f9952ad58a183e: the added parsed.size() > 2 guard completes the multipath acceptance rule introduced there. Likewise, fold 3adce006f87a4111e0790c8f0afb0146c14de27b, including its header change and test, into the row-list introduction e2d4d84b696d3d1f7e62b62cc3b4eb40df9a2b3d. At its direct parent 0b7dd5c3567d284565deafa8f4fc91bef57ddc1e, row grouping compares displayed origin labels and can merge different keys; the correction uses key_id. These rearrangements retain the final tree while letting reviewers assess each feature with its actual validation and identity rules. They concern review flow, not defects remaining at the PR head.