From e2ba275cb9a01bb06fc12eb51b86c5ce935f7b24 Mon Sep 17 00:00:00 2001 From: draoi Date: Wed, 26 Jun 2024 09:21:23 +0200 Subject: [PATCH] session/mod: use !p2p.connected() instead of channels().is_empty() --- src/net/session/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/session/mod.rs b/src/net/session/mod.rs index 371e5c481..783ba63ce 100644 --- a/src/net/session/mod.rs +++ b/src/net/session/mod.rs @@ -85,7 +85,7 @@ pub async fn remove_sub_on_stop(p2p: P2pPtr, channel: ChannelPtr, type_id: Sessi // Remove channel from the HostRegistry. Free up this addr for any future operation. hosts.unregister(channel.address()); - if hosts.channels().is_empty() { + if !p2p.is_connected() { hosts.disconnect_publisher.notify(Error::NetworkNotConnected).await; } debug!(target: "net::session::remove_sub_on_stop()", "[END]");