WIP: qt: refactor QML frontend onto owned models

bitcoin-core/gui-qml: PR #1142

2 minor findings · 3 suggestions

Earlier concerns neither republished nor resolved: 1 major finding · 17 minor findings · 17 suggestions. See the Run archive for their assessments.

Findings

Link

[minor] · The console labels implicit wallet RPCs as node commands

When no wallet is selected and exactly one is loaded, wallet RPCs run in that wallet although the console says “Executing command without any wallet” and records a node target.

Location: qml/models/rpccommandexecutor.cpp:281 (head).

Details and suggested fix

Loading the first wallet through loadwallet, createwallet, or another RPC client now leaves it unselected; base adoption selected it. The settings console consequently submits Target::Node. RpcCommandExecutor::Execute supplies an empty URI for that target, but pinned Core's GetWalletForJSONRPCRequest resolves it to the sole loaded wallet. Commands such as getbalance therefore execute there without the wallet's row or history tag. The recall guard also skips these entries because it only checks history recorded as Target::Wallet.

Give the console an explicit target for the sole adopted wallet when nothing is selected, and capture that target consistently for execution and history. Add a real-Core test starting with no selection and one externally loaded wallet; the existing external-load case starts with another wallet selected.


Link

[minor] · Send omits partial-spend avoidance in avoid_reuse wallets

With default partial-spend settings, a payment from an avoid_reuse wallet can consume one output at an address and leave the others dirty, excluding them from subsequent Send balance and maximum calculations.

Location: qml/models/coinselection.h:33 (head).

Details and suggested fix

ApplyInputPolicy sets m_avoid_address_reuse but leaves m_avoid_partial_spends at its -avoidpartialspends default. Pinned Core's sendtoaddress explicitly pairs these flags. Although CreateTransaction retries with grouping, the default m_max_aps_fee is zero, so it keeps the ungrouped result when grouping costs more. A partial spend then marks the address used, making its remaining outputs ineligible for Send.

Enable m_avoid_partial_spends when the wallet has avoid_reuse enabled, while preserving the existing default for other wallets. Add a case with two clean outputs at one address and a payment smaller than either; the existing reuse-policy test checks filtering after outputs are already dirty.


Optional improvements

Link

[suggestion] · Speed Up omits the avoid_reuse policy now enforced by Send

Speed Up retains a pre-existing gap, also present in Core's bumpfee: when a replacement needs another input, an avoid_reuse wallet may contribute a dirty output.

Location: qml/walletbump.cpp:110 (head).

Details and suggested fix

walletbump::Prepare creates a CCoinControl without setting m_avoid_address_reuse, whose default is false. Core copies that control, permits additional confirmed inputs, and calls CreateTransaction. Its availability filter consequently permits dirty outputs despite the wallet's opt-in policy. CheckApprovedScope rechecks spent status and confirmation depth, not reuse status. Set control.m_avoid_address_reuse = true before construction, as Send now does; Core ignores the filter for wallets without the flag. Add a fee-bump case requiring an extra input with dirty and clean confirmed candidates. This is a policy-consistency suggestion, not a regression from base.


Link

[suggestion] · The fee and signer helper commits describe enforcement added later

The fee-authentication and signer-substitution helper commits describe completed enforcement that is only wired into later extraction commits, making the checks harder to locate during review.

Location: qml/models/psbtfee.cpp:18 at 24569c9652c3 (commit) (commit).

Details and suggested fix

24569c9652c3b1bd3f460d9f6e0dc9d2e172de2f adds the psbtfee helpers but says the authenticated fee is used in review and broadcast and carries Fixes #1063. Likewise, 2345b0d3c3d1968108df830b6291ec4d5fedfb55 describes refusing substituted transactions but only adds MatchesUnsignedTransaction. The enforcing calls arrive in walletsend.cpp through fcb13840924ebc29739b456cc2644a193bfa60cc and in walletbump.cpp through 53d3fab03864ef2d31dc8594c9a116bc30ceccb5. Keep the tested helpers as preparatory commits, but describe that role, identify the later enforcing commits and functions, and move the Fixes #1063 trailer to the wiring commit. This makes the series easier to validate without moving architecture-dependent call sites or implying a defect at head.


Link

[suggestion] · The lifetime-guard commit also changes password-prompt behavior

The deferred-close fix also introduces error dismissal and changes bound-prompt closing, but its message describes only the lifetime guard and its added test exercises error dismissal.

Location: qml/controls/AlertPopup.qml:39 at 702bf2c2948e (commit) (commit).

Details and suggested fix

702bf2c2948ea41c92724651fb1364954d702a53 adds AlertPopup.errorDismissed and shownErrorText, wires password editing and submission to them, and adds test_editing_password_clears_shown_error. Separately, adding !bound means an invalidated bound prompt now relies on its owner's state to close, rather than scheduling its own close. Neither behavior is described by the lifetime-guard message. Split the root && guard, the error-dismissal API with its wiring and test, and the bound-prompt policy into separately explained commits. Preserve the owner-controlled closing contract; this is a review-boundary concern, not evidence that the final behavior is wrong. Other alerts retain their existing appearance because errorDismissed defaults to false.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

Reuse avoidance is an adversarial privacy policy. Its original documentation describes an attacker sending near-dust outputs to previously used addresses so those outputs are inadvertently included in later payments and reveal spending activity. The policy distinguishes used destinations and excludes them from ordinary coin selection, together with avoiding partial spends.

This is the historical reason the affected Send balance, maximum and coin-selection workflows must be understood in terms of wallet policy rather than merely the sum of available-looking outputs. The original documentation also notes that rescanning is needed to classify previously used destinations correctly.

Source 1

Pruning exposes a storage-versus-recovery tradeoff that historically motivated explicit GUI warnings. Early discussion stressed that the target concerns block storage rather than total disk use, may be exceeded, and can leave historical data unavailable for wallet rescans, potentially requiring a lengthy resynchronization.

This contextualizes the affected storage settings and Close-wallet warning: closing a wallet on a pruning node can have a recovery cost beyond temporarily hiding its pages. The inspected historical comment argues for making that cost visible; it does not establish that every modern wallet import or reopening requires a full resync.

Source 1