- create_announced_chan_between_nodes(&nodes, 0, 1, channelmanager::provided_init_features(), channelmanager::provided_init_features());
+ if reload_node && nodes[0].node.per_peer_state.read().unwrap().len() == 0 {
+ // If we dropped the channel before reloading the node, nodes[1] was also dropped from
+ // nodes[0] storage, and hence not connected again on startup. We therefore need to
+ // reconnect to the node before attempting to create a new channel.
+ nodes[0].node.peer_connected(&nodes[1].node.get_our_node_id(), &Init { features: nodes[1].node.init_features(), remote_network_address: None }, true).unwrap();
+ }
+ create_announced_chan_between_nodes(&nodes, 0, 1);