Fix persister/chain_monitor lifetimes.
authorArik Sosman <git@arik.io>
Tue, 22 Aug 2023 02:24:49 +0000 (19:24 -0700)
committerArik Sosman <git@arik.io>
Tue, 22 Aug 2023 21:23:55 +0000 (14:23 -0700)
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

index ebbb9c4728668804cb8485fd06a9eac288d29f23..2997a178ae802724147a757d5f42a22df6c1e76b 100644 (file)
@@ -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;