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

lightningd: only run watchman under --experimental-bwatch

Public commit record

What the developer wrote

Authored by Sangbida Chaudhuri

73/100 · Adequate
lightningd: only run watchman under --experimental-bwatch

The flag is registered by the bwatch plugin, not lightningd, so peek
at the parsed configvars. Without it ld->watchman stays NULL and the
watchman_* entry points are no-ops, leaving chain_topology as the only
chain watcher: bwatch and the legacy path must not race each other.

The bwatch pytests opt in explicitly (with rescan=0) instead of
enabling bwatch globally.

Changelog-Experimental: wallet: Add bwatch-driven wallet transaction and UTXO tracking behind --experimental-bwatch.

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

What changed, and why it matters

This commit gates a new experimental chain-watching subsystem called 'bwatch' behind an explicit --experimental-bwatch flag. Previously, the watchman helper was always created, which could have caused both the old chain watcher and the new bwatch watcher to run at the same time and race against each other. The change makes the watchman a no-op unless the user explicitly opts in, so ordinary users continue using the legacy path only.

Recommended action

Treat this as a hardening/race-prevention change rather than an active vulnerability. If running pre-patch builds with bwatch present, verify that --experimental-bwatch was not enabled by default and that no dual-watcher races occurred. No emergency action is indicated by the diff alone.

Security signals we found

01

Race condition between legacy chain watcher and new bwatch watcher prevented by gating watchman creation behind an opt-in flag

02

watchman_* entry points made NULL-safe so disabled code paths are explicit no-ops

03

JSON RPC command now returns a controlled error instead of dereferencing a NULL watchman

04

Experimental feature explicitly marked as opt-in via --experimental-bwatch

Risk score

Why this scored 33/100

Our methodology →
Potential impact 8/30
Exploitability 5/25
Stealth signal 4/15
Affected reach 6/15
Confidence 7/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.