frozen coins are never spendable, and a rescan already running is adopted

four wallet defects, none urgent, all cheap:

selectCoins let an explicit coin-control pick override a freeze. naming an
outpoint now overrides only the confirmed-only default; frozen is absolute.

balances counted frozen coins in onchainConfirmed, so Send showed a figure a
max-value spend could not reach. Balances gains onchainFrozen — a component of
confirmed, not a deduction — filled at the route layer, because freezing is
Officer policy in Postgres and no backend can see it. The route only reads utxos
when something is actually frozen. Send subtracts it under "Spendable";
Overview lists it beside unconfirmed.

a rescan in flight upstream was invisible after a sidecar restart, and a second
POST would have queued behind it (scantxoutset is single-threaded node-wide).
adoptRescan polls an existing NBXplorer scan instead of starting one, and the
GET route falls back to it when local state is gone.

the per-variant scan deadline counted queue time, so a variant that sat behind
another wallet's scan timed out without ever having run. the deadline now
refreshes while the status reads Queued.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-04 20:56:37 +00:00
co-authored by Claude Opus 5
parent e0f6a469aa
commit a61d5c3a91
14 changed files with 191 additions and 18 deletions
@@ -138,6 +138,15 @@ export interface WalletChainSource {
*/
startRescan?(accounts: readonly ScanAccount[]): RescanHandle;
/**
* Find a scan already in flight upstream and return a handle to it, without starting one.
*
* Same handle contract as `startRescan`, so the caller chains its refresh onto `done` identically —
* which is the point: an adopted scan has to end in a snapshot rebuild too, or the coins it recovered
* stay invisible. Null when nothing is running.
*/
adoptRescan?(accounts: readonly ScanAccount[]): Promise<RescanHandle | null>;
/** The rescan in flight, or the last one's outcome. Null when this source has never run one. */
rescanState?(): RescanState | null;
}