wallet: load closed channels at init

This seems to have been inadvertently omitted in the recent
closed channel refactor.

Fixes: #8346

Changelog-None: Changed this release.
This commit is contained in:
Alex Myers 2025-06-11 13:29:35 -05:00 committed by Rusty Russell
parent 40d319b7be
commit 9d160eb8fb
2 changed files with 7 additions and 0 deletions

View File

@ -122,6 +122,12 @@ def test_closing_simple(node_factory, bitcoind, chainparams):
tags = check_utxos_channel(l1, [channel_id], expected_1)
check_utxos_channel(l2, [channel_id], expected_2, tags)
# Forget channel
bitcoind.generate_block(50)
sync_blockheight(bitcoind, [l1])
l1.restart()
assert only_one(l1.rpc.listclosedchannels()['closedchannels'])['channel_id'] == channel_id
def test_closing_while_disconnected(node_factory, bitcoind, executor):
l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True})

View File

@ -2344,6 +2344,7 @@ bool wallet_init_channels(struct wallet *w)
{
/* We set the max channel database id separately */
set_max_channel_dbid(w);
wallet_load_closed_channels(w, w->ld->closed_channels);
return wallet_channels_load_active(w);
}