]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Connect peers on startup in background-processor tests 2021-07-1019-test-fix
authorMatt Corallo <git@bluematt.me>
Sat, 31 Jul 2021 14:41:38 +0000 (14:41 +0000)
committerMatt Corallo <git@bluematt.me>
Sat, 31 Jul 2021 14:41:38 +0000 (14:41 +0000)
lightning-background-processor/src/lib.rs

index 55ac14c048c412e8a9d0a7f17318d62b7569b3f6..319111ae4e58d45c8f510ad71392304257d24716 100644 (file)
@@ -223,7 +223,7 @@ mod tests {
        use lightning::get_event_msg;
        use lightning::ln::channelmanager::{BREAKDOWN_TIMEOUT, ChainParameters, ChannelManager, SimpleArcChannelManager};
        use lightning::ln::features::InitFeatures;
-       use lightning::ln::msgs::ChannelMessageHandler;
+       use lightning::ln::msgs::{ChannelMessageHandler, Init};
        use lightning::ln::peer_handler::{PeerManager, MessageHandler, SocketDescriptor};
        use lightning::util::config::UserConfig;
        use lightning::util::events::{Event, MessageSendEventsProvider, MessageSendEvent};
@@ -297,6 +297,12 @@ mod tests {
                        let node = Node { node: manager, peer_manager, chain_monitor, persister, tx_broadcaster, logger, best_block };
                        nodes.push(node);
                }
+               for i in 0..num_nodes {
+                       for j in i..num_nodes {
+                               nodes[i].node.peer_connected(&nodes[j].node.get_our_node_id(), &Init { features: InitFeatures::known() });
+                               nodes[j].node.peer_connected(&nodes[i].node.get_our_node_id(), &Init { features: InitFeatures::known() });
+                       }
+               }
                nodes
        }