mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
session/mod: use !p2p.connected() instead of channels().is_empty()
This commit is contained in:
@@ -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]");
|
||||
|
||||
Reference in New Issue
Block a user