Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/bkpr/blockheights.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ struct blockheights *init_blockheights(const tal_t *ctx,
if (keytok->size != 3)
goto weird;

if (!json_to_txid(buf, keytok + 2, &txid))
if (!json_to_txid(buf, keytok + 3, &txid))
goto weird;
if (!json_hex_to_be32(buf, hextok, &be_blockheight))
goto weird;
Expand Down
7 changes: 7 additions & 0 deletions tests/test_bookkeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,3 +1193,10 @@ def test_listincome_timebox(node_factory, bitcoind):

incomes = l1.rpc.bkpr_listincome(end_time=first_one)['income_events']
assert [i for i in incomes if i['timestamp'] > first_one] == []

# We save blockheights in storage, so make sure we restore them on restart!
acctevents_before = l1.rpc.bkpr_listaccountevents()
l1.restart()

acctevents_after = l1.rpc.bkpr_listaccountevents()
assert acctevents_after == acctevents_before
Loading