AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 34 Bitcoin

wallet: read UTXO state from our_outputs

Public commit record

What the developer wrote

Authored by Sangbida Chaudhuri

68/100 · Adequate
wallet: read UTXO state from our_outputs

With every writer dual-writing since the previous two commits, flip
the readers: all UTXO queries (listfunds, coin selection, reservations,
onchaind close info) now come from our_outputs, and the legacy-only
read helpers (wallet_stmt2output, gather_utxos, db_get_unspent_utxos)
are deleted.

our_output_row_to_utxo replaces wallet_stmt2output, using channel_dbid
to discriminate HD outputs from channel-close outputs, and
wallet_get_spendable_utxos centralizes the unspent+unreserved query
that wallet_find_utxo and wallet_has_funds previously duplicated.

migrate_setup_coinmoves keeps reading the legacy table directly: that
migration runs at v25.09, before our_outputs exists.

Co-authored-by: Cursor <cursoragent@cursor.com>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit switches Core Lightning's wallet code to read UTXO (unspent transaction output) data from a new database table called our_outputs instead of the older outputs table. It also deletes several old helper functions and updates tests to use the new data model. The change is part of an internal database migration and includes dual-writing safeguards so older versions of the software can still read the legacy table. There is no direct evidence in the commit of a security vulnerability being fixed.

Recommended action

Treat this as a high-risk refactoring rather than an active vulnerability. Review the new our_output_row_to_utxo conversion logic for data fidelity (especially blockheight/txindex/coinbase handling, channel_dbid discrimination, and scriptPubKey type mapping), verify that dual-write mirroring remains consistent under crashes and reorgs, and run wallet migration and downgrade tests before release. Monitor for any follow-up fixes that may indicate latent bugs.

Security signals we found

01

Large internal data-model migration with reader/writer split between old and new tables

02

Dual-write mirroring to legacy outputs table for downgrade compatibility

03

Deletion of legacy UTXO reading helpers

04

Change in reservation behavior: re-reserving now extends reservation instead of failing

05

Addition of ON CONFLICT DO NOTHING to legacy outputs insert in wallet_add_onchaind_utxo

06

No explicit security bug fix, CVE, or vulnerability disclosure in commit message or diff

Risk score

Why this scored 34/100

Our methodology →
Potential impact 5/30
Exploitability 5/25
Stealth signal 5/15
Affected reach 10/15
Confidence 6/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.