diff --git a/src/net/p2p.rs b/src/net/p2p.rs index 4c5573b6a..dd77d0de7 100644 --- a/src/net/p2p.rs +++ b/src/net/p2p.rs @@ -159,6 +159,11 @@ impl P2p { /// Stop the running P2P subsystem pub async fn stop(&self) { + // Stop all channels + for channel in self.hosts.channels().await { + channel.stop().await; + } + // Stop the sessions self.session_manual().stop().await; self.session_inbound().stop().await; diff --git a/src/net/session/outbound_session.rs b/src/net/session/outbound_session.rs index 8ce751ead..3db05104c 100644 --- a/src/net/session/outbound_session.rs +++ b/src/net/session/outbound_session.rs @@ -162,7 +162,6 @@ impl Slot { } async fn start(self: Arc) { - // TODO: way too many clones, look into making this implicit. See implicit-clone crate let ex = self.p2p().executor(); self.process.clone().start(