Skip to content

Commit bcbd4f1

Browse files
committed
Connect peers on startup in tests
This avoids `ChannelManager` ever being confused by the fact that it received a message from a peer which it didn't think it was connected to.
1 parent e26c9b0 commit bcbd4f1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,13 @@ pub fn create_network<'a, 'b: 'a, 'c: 'b>(node_count: usize, cfgs: &'b Vec<NodeC
14041404
})
14051405
}
14061406

1407+
for i in 0..node_count {
1408+
for j in (i+1)..node_count {
1409+
nodes[i].node.peer_connected(&nodes[j].node.get_our_node_id(), &msgs::Init { features: InitFeatures::known() });
1410+
nodes[j].node.peer_connected(&nodes[i].node.get_our_node_id(), &msgs::Init { features: InitFeatures::known() });
1411+
}
1412+
}
1413+
14071414
nodes
14081415
}
14091416

0 commit comments

Comments
 (0)