net: p2p.stop() calls channel.stop() on all channels

This commit is contained in:
zero
2024-04-08 09:17:59 +02:00
parent af8f1e9d20
commit c2c967a673
2 changed files with 5 additions and 1 deletions

View File

@@ -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;

View File

@@ -162,7 +162,6 @@ impl Slot {
}
async fn start(self: Arc<Self>) {
// TODO: way too many clones, look into making this implicit. See implicit-clone crate
let ex = self.p2p().executor();
self.process.clone().start(