From 62e1d2f68e25b9fef6c88dd404af16d8affcb291 Mon Sep 17 00:00:00 2001 From: Alex Myers Date: Wed, 11 Jun 2025 13:29:35 -0500 Subject: [PATCH] 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. --- tests/test_closing.py | 6 ++++++ wallet/wallet.c | 1 + 2 files changed, 7 insertions(+) diff --git a/tests/test_closing.py b/tests/test_closing.py index f4ef887e5831..35fa130fbe4a 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -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}) diff --git a/wallet/wallet.c b/wallet/wallet.c index 0502600817d5..75f3b6fae18a 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -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); }