Skip to content

Commit 8db015b

Browse files
committed
bookkeeper: 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 <[email protected]> Changelog-Fixed: Plugins: `bookkeeper` now correctly restores chain event blockheights it has derived.
1 parent 8d79dc0 commit 8db015b

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

plugins/bkpr/blockheights.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ struct blockheights *init_blockheights(const tal_t *ctx,
140140
if (keytok->size != 3)
141141
goto weird;
142142

143-
if (!json_to_txid(buf, keytok + 2, &txid))
143+
if (!json_to_txid(buf, keytok + 3, &txid))
144144
goto weird;
145145
if (!json_hex_to_be32(buf, hextok, &be_blockheight))
146146
goto weird;

tests/test_bookkeeper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,6 @@ def test_migration_no_bkpr(node_factory, bitcoind):
11641164
'type': 'channel'}]
11651165

11661166

1167-
@pytest.mark.xfail(strict=True)
11681167
@unittest.skipIf(TEST_NETWORK != 'regtest', "External wallet support doesn't work with elements yet.")
11691168
def test_listincome_timebox(node_factory, bitcoind):
11701169
l1 = node_factory.get_node()

0 commit comments

Comments
 (0)