Commit message · Rusty Russellbookkeeper: fix restoration of derived wallet blockheights on restart.
We complain:
```
lightningd-1 2025-10-31T00:55:00.377Z **BROKEN** plugin-bookkeeper: Unparsable blockheight datastore entry: {"key":["bookkeeper","blockheights","756999f870a7a7c97f5c143f12b9096a50d1b1acd74aeb9ab2dc251a5c361494"],"generation":0,"hex":"00000067"}
```
And we don't have the blockheight:
```
{
'account': 'external',
- 'blockheight': 103,
? - -
+ 'blockheight': 0,
'credit_msat': 555555000,
'currency': 'bcrt',
'debit_msat': 0,
'origin': 'wallet',
'outpoint': '756999f870a7a7c97f5c143f12b9096a50d1b1acd74aeb9ab2dc251a5c361494:0',
'tag': 'deposit',
'timestamp': 1761872097,
'type': 'chain',
},
```
Reported-by: @michael1011
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: Plugins: `bookkeeper` now correctly restores chain event blockheights it has derived.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 21/100This commit fixes a bookkeeping bug in Core Lightning's bookkeeper plugin. On restart, the plugin was reading the wrong part of a stored data key when trying to restore transaction block heights, causing it to log a 'BROKEN' error and set block heights to 0. The fix is a one-line change correcting an array index offset. It is a data-integrity/functional bug, not an exploitable security vulnerability.