From 43a9215b796b4e3bf4d65845adf4c906e9ce8eeb Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Mon, 21 Aug 2023 19:24:49 -0700 Subject: [PATCH] Fix persister/chain_monitor lifetimes. The persister and chain_monitor variables must be declared before the node channel manager is initialized to avoid out of order deallocation. --- lightning/src/ln/functional_tests.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lightning/src/ln/functional_tests.rs b/lightning/src/ln/functional_tests.rs index ebbb9c472..2997a178a 100644 --- a/lightning/src/ln/functional_tests.rs +++ b/lightning/src/ln/functional_tests.rs @@ -10047,8 +10047,9 @@ fn do_test_multi_post_event_actions(do_reload: bool) { // - one from an RAA and one from an inbound commitment_signed. let chanmon_cfgs = create_chanmon_cfgs(3); let node_cfgs = create_node_cfgs(3, &chanmon_cfgs); + let (persister, chain_monitor); let node_chanmgrs = create_node_chanmgrs(3, &node_cfgs, &[None, None, None]); - let (persister, chain_monitor, nodes_0_deserialized); + let nodes_0_deserialized; let mut nodes = create_network(3, &node_cfgs, &node_chanmgrs); let chan_id = create_announced_chan_between_nodes(&nodes, 0, 1).2; -- 2.39.5