2 major findings · 6 minor findings · 4 suggestions
Findings
[major] · Quitting during the import rescan retains incomplete wallet history
Quitting during a historical descriptor import can leave an automatically reopened view-only wallet with missing transactions and an understated balance because shutdown interruption is not treated as an import failure.
Location: qml/walletqmlcontroller.cpp:698 (head).
Details and suggested fix
The callback accepts the import whenever no result has an error. During application shutdown, Core is interrupted before the wallet-command worker drains. The pinned scanner exits with USER_ABORT, but ScanFromTime returns the requested start time and ProcessDescriptorsImport checks only the separate IsAborting() flag. Consequently, an otherwise successful import returns no error and createWalletAsync retains the wallet.
Creation enables startup loading and persists the current tip as the wallet's best block. This import scan uses save_progress=false, and normal reopening starts from the persisted locator rather than the interrupted historical position. The GUI completion is discarded during shutdown, so no success page appears, but the incomplete wallet still loads next time. Persist a pending-rescan state before starting this operation and honour it on reopening. Add a regression test that quits during a historical import and verifies recovery after restart.
[major] · Nested-SegWit-only and legacy-only imports retain unsupported bech32 defaults
Under default settings, new nested-SegWit-only and legacy-only imports cannot generate the initial Receive address or prepare payments to SegWit/Taproot recipients when change is required.
Location: qml/viewonlyimport.cpp:349 (head).
Details and suggested fix
ParseExtendedKey now installs only the inferred or selected script type, such as sh(wpkh(...)) for a ypub or pkh(...) for a BIP44 origin. However, availableReceiveAddressTypes filters only Taproot availability. Without a saved Receive preference, it selects bech32, and getNewDestination fails because that external manager does not exist. Manually selecting the imported type in Receive settings works around this part.
Transaction preparation independently leaves m_change_type unset. With default address/change configuration, Core chooses the imported nested-SegWit or legacy manager for a matching recipient, but falls back to bech32 for SegWit/Taproot recipients. If change is required, preparation fails with “Transaction needs a change address, but we can't generate it.” Derive Receive availability and its default from active external descriptors, and select change from available internal managers. Cover both Receive and unsigned transaction preparation for these imports.
[minor] · Pruning rejection leaves a wallet database that blocks the suggested retry
The new pruning rejection runs after database creation and uses existing unload-only cleanup, so changing the date and retrying with the same wallet name fails.
Location: qml/walletqmlcontroller.cpp:693 (head).
Details and suggested fix
When the requested historical blocks have been pruned, ScanBlocksPruned returns an error advising the user to choose a later date. This check runs inside setup_wallet, after walletLoader().createWallet() has created the blank view-only wallet. The failure path calls remove(), but the pinned implementation only unloads the wallet and updates startup settings; it does not delete its database. A retry with a later date then fails with “A wallet with this name already exists” because name availability consults listWalletDir(). Run the prune-availability preflight before creating the database, using chain access rather than a newly created wallet. The existing cleanup test checks remove_calls, not filesystem rollback or successful retry.
[minor] · Long import rescans have no progress or cancellation controls
Historical imports occupy the shared wallet-command worker while the form hides Back and Close and provides neither scan progress nor cancellation.
Location: qml/walletqmlcontroller.cpp:697 (head).
Details and suggested fix
createWalletAsync performs creation and setup in one task, and setup now calls importDescriptors, including its historical rescan. Choosing “Earlier, or not sure” supplies timestamp zero. BackendExecutor executes that task synchronously on one worker, so wallet loads submitted to the same executor wait behind it. Meanwhile, the form hides Back and Close and displays only “Looking for this wallet's transactions.” The option warns that scanning can take hours, but users cannot inspect progress or cancel through the form; quitting is not a safe substitute because the interrupted scan can be retained as complete. Wire handleShowProgress and abortRescan to the creation operation, with explicit cancellation and incomplete-history handling.
[minor] · Descriptor validation succeeds before a predictable post-creation import failure
Malformed import inputs can enable Create and fail after database creation, leaving a wallet that blocks same-name retries; no exporter producing these inputs was identified.
Location: qml/viewonlyimport.cpp:75 (head).
Details and suggested fix
CheckDescriptor parses syntax and checks private keys, output type, key count and script shape, but never calls Expand(0, ...). A descriptor such as wpkh(xpub/1h/*) therefore receives a valid summary even though Core rejects its hardened public derivation. JSON validation likewise omits Core's checks for active non-ranged descriptors, prohibited labels and out-of-range next_index values. Submission creates the database before those checks run in ImportDescriptor; rejection then unloads rather than deletes the wallet. Validate expansion and these request constraints before reporting the input as valid and creating the database. The hardened-after-xpub example is a plausible editing error, but its production occurrence is unconfirmed.
[minor] · Conflicting active descriptors remain active in the preview
Combined account pastes can show both receive descriptors active although only the last issues addresses; no current exporter producing such a batch was identified.
Location: qml/viewonlyimport.cpp:216 (head).
Details and suggested fix
ParseLines marks every ranged descriptor active, and JSON parsing preserves explicit active flags without resolving conflicts. For two lines such as wpkh(xpubA/0/*) and wpkh(xpubB/0/*), Core activates each manager in turn and replaces the same external output-type slot, leaving only the second active. DescribeViewOnlyImport instead copies each request's original active flag, so neither row gets the “Not active” indicator. Both descriptors remain imported and watched; the mismatch concerns which one hands out addresses. Compute each row's effective active state using the same slot-replacement rules as Core before presenting the preview.
[minor] · Origin-only grouping merges different receive and change keys
Different xpubs with identical supplied origins can appear as one key covering receive and change in the preview; no current producer of this mismatched input was identified.
Location: qml/viewonlyimport.cpp:411 (head).
Details and suggested fix
KeyLabel returns the origin string whenever one is present, and DescribeViewOnlyImport uses that display label as the key identity when merging coverage. Thus receive key [d34db33f/84h/0h/0h]xpubA/0/* and change key [d34db33f/84h/0h/0h]xpubB/1/*, with matching type and active/ranged state, combine into one “receive and change” row despite using different keys. Erroneous or hostile origin metadata can trigger this because it does not authenticate the public key. The full descriptors remain in the input field; the summarized preview is misleading. Group by the serialized public key plus origin, keeping the origin alone only as a display label, and add a mismatched-key regression case.
[minor] · Three-way multipath imports incorrectly promise change coverage
Pasted descriptors such as wpkh(xpub/<0;1;2>/*) are previewed as receive and change, although Core imports all three expansions as external.
Location: qml/viewonlyimport.cpp:100 (head).
Details and suggested fix
CheckDescriptor sets Source::multipath for any parsed.size() > 1, and the preview gives every such source both receive and change coverage. ParseLines leaves internal unspecified for these requests. However, the pinned ImportDescriptor assigns the second expansion to change only when there are exactly two expansions; with three or more, all remain external. Pasting the example alone therefore succeeds without an internal descriptor despite the preview's promise. Reject multipath descriptors with more than two expansions before showing a valid preview, and cover that case in a test. Generated extended-key paths always use <0;1> and are unaffected.
Optional improvements
[suggestion] · Pruning recovery advice refers to a hidden date choice
For fully dated listdescriptors JSON, the form hides the birth-date options but still tells users to “Choose a later date” when the required blocks have been pruned.
Location: qml/walletqmlcontroller.cpp:694 (head).
Details and suggested fix
DescribeViewOnlyImport reports needsBirthDate=false when every JSON entry supplies its timestamp, so the date section is hidden. ScanBlocksPruned nevertheless uses those supplied timestamps and returns the same later-date instruction as for undated input. Following that instruction would require editing the pasted metadata rather than changing a visible control. Use a dated-input-specific message explaining that the supplied dates require unavailable blocks and directing the user to a node retaining those blocks.
[suggestion] · A mistyped origin-prefixed key receives a JSON error
When [fingerprint/path]key matches KEY_ORIGIN but its key has a bad checksum or unknown version, the form reports “This is not valid JSON.”
Location: qml/viewonlyimport.cpp:368 (head).
Details and suggested fix
ReadExtendedKey returns an unrecognized result for checksum or version failures. Even after KEY_ORIGIN matched, ParseViewOnlyImport then routes the leading [ to ParseJson, which rejects the origin-prefixed key as JSON. Recognized private, multisig and wrong-network keys already receive targeted errors. When the origin expression matched but the key was unrecognized, return a key-specific error such as “This extended public key is not valid” instead.
[suggestion] · Replacing the imported key retains its predecessor's type and date choices
Pasting a different plain xpub retains the previous key's address-type and birth-date selections and immediately enables Create, although the checked options remain visible.
Location: qml/pages/wallet/CreateWalletForm.qml:125 (head).
Details and suggested fix
addressTypeChoice and birthChoice are independent form properties. The import field's edit handler only clears load status, and importReady requires merely that those properties are nonempty. Consequently, replacing one plain xpub with another reuses choices made for the first wallet, despite the form asking users to check the key's source wallet for its address type. Reset both choices when the parsed key identity changes so the replacement key requires fresh selections, while preserving them for harmless formatting edits.
[suggestion] · Conflicting SLIP-132 and origin-purpose metadata goes unexplained
A pasted zpub with a BIP44 origin selects wpkh without identifying the conflict; no exporter producing this combination was identified.
Location: qml/viewonlyimport.cpp:342 (head).
Details and suggested fix
ParseExtendedKey gives key.type precedence over PurposeType(path), and the test deliberately expects a zpub with /44'/0'/0' to produce wpkh. Because a type was inferred, the chooser is hidden. The summary displays Bech32, but does not explain the contradictory metadata, leaving no diagnostic clue if the origin indicated the intended source-wallet script type and the import finds no history. Flag the conflict before import, even if compatibility policy keeps the prefix authoritative; neither signal's precedence needs to be treated as a protocol requirement.