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

wallet: create bwatch tables before backfilling them

Public commit record

What the developer wrote

Authored by daywalker90

83/100 · Strong
wallet: create bwatch tables before backfilling them

Databases from v26.06.10 are at migration version 284 and never ran the
our_outputs/our_txs CREATE TABLE migrations, which master placed at
indices 283/284. On upgrade, migrate_backfill_bwatch_tables (index 285)
then inserts into our_outputs and fails with "no such table".

Create both tables with IF NOT EXISTS at the start of the backfill, so it
works whether or not the earlier CREATEs ran. Existing databases already
have the tables, so this is a no-op for them.

Add a unit test that starts from a v26.06.10-shaped database without the
bwatch tables.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a database upgrade bug in Core Lightning. Wallets created with version v26.06.10 were missing two new tables (our_outputs and our_txs) because they skipped the migrations that create them. When users later upgraded, a follow-up migration tried to insert data into those non-existent tables and crashed. The fix simply creates the tables if they don't already exist right before filling them, and adds a test that simulates the problematic v26.06.10 database state. It is a reliability/data-integrity fix, not an exploitable security vulnerability.

Recommended action

No immediate security action required. This is a bug-fix commit that should be included in the next release to ensure v26.06.10 users can upgrade without migration failure. Operators who already upgraded successfully are unaffected.

Security signals we found

01

Database migration failure could prevent node startup after upgrade

02

Fixes missing table creation before data backfill

03

Adds regression test for upgrade path from v26.06.10

Risk score

Why this scored 27/100

Our methodology →
Potential impact 8/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 5/15
Confidence 9/10
Evidence quality 5/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.