From: Arik Sosman Date: Tue, 22 Aug 2023 02:24:49 +0000 (-0700) Subject: Fix persister/chain_monitor lifetimes. X-Git-Tag: v0.0.117-alpha1~47^2~4 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=43a9215b796b4e3bf4d65845adf4c906e9ce8eeb;p=rust-lightning 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. --- 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;