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

bkpr: limp along if we lost our db.

Public commit record

What the developer wrote

Authored by Rusty Russell

76/100 · Adequate
bkpr: limp along if we lost our db.

We can't really do decent bookkeeping any more, but don't crash!

```
bookkeeper: plugins/bkpr/recorder.c:178: find_txo_chain: Assertion `acct->open_event_db_id' failed.
bookkeeper: FATAL SIGNAL 6 (version v25.12)
0xaaaab7d51a7f send_backtrace
common/daemon.c:38
0xaaaab7d51b2b crashdump
common/daemon.c:83
0xffff8c0b07cf ???
???:0
0xffff8bdf7608 __pthread_kill_implementation
./nptl/pthread_kill.c:44
0xffff8bdacb3b __GI_raise
../sysdeps/posix/raise.c:26
0xffff8bd97dff __GI_abort
./stdlib/abort.c:79
0xffff8bda5cbf __assert_fail_base
./assert/assert.c:96
0xffff8bda5d2f __assert_fail
./assert/assert.c:105
0xaaaab7d41fd7 find_txo_chain
plugins/bkpr/recorder.c:178
0xaaaab7d421fb account_onchain_closeheight
plugins/bkpr/recorder.c:291
0xaaaab7d37687 do_account_close_checks
plugins/bkpr/bookkeeper.c:884
0xaaaab7d38203 parse_and_log_chain_move
plugins/bkpr/bookkeeper.c:1261
0xaaaab7d3871f listchainmoves_done
plugins/bkpr/bookkeeper.c:171
0xaaaab7d4811f handle_rpc_reply
plugins/libplugin.c:1073
0xaaaab7d4827b rpc_conn_read_response
plugins/libplugin.c:1377
0xaaaab7d889a7 next_plan
ccan/ccan/io/io.c:60
0xaaaab7d88f7b do_plan
ccan/ccan/io/io.c:422
0xaaaab7d89053 io_ready
ccan/ccan/io/io.c:439
```

Fixes: https://github.com/ElementsProject/lightning/issues/8854
Changelog-Fixed: Plugins: `bkpr_listbalances` no longer crashes if we lost our db, then do emergencyrecover and close a channel.
Reported-by: https://github.com/enaples
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a crash in Core Lightning's bookkeeper plugin. After a user loses their main database and runs emergency recovery, then closes a channel, the bookkeeper plugin would hit an internal assertion and crash the whole node. The fix makes the plugin log a warning and continue running instead of crashing.

Recommended action

Apply the patch. Users who have run emergencyrecover and then close channels should upgrade to avoid bookkeeper crashes. No immediate remote exploitability, but the crash is disruptive.

Security signals we found

01

Denial-of-service condition triggered by missing database state after recovery

02

Assertion failure in plugin leading to fatal signal and node crash

03

Fix removes assert() on nullable pointer and adds graceful degradation

Risk score

Why this scored 44/100

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