Bladeren bron

inbound_session: remove redudant subscribe_stop() call

Channel cleanup happens in the register_channel call, therefore calling
it here is unnecessary and confusing.
draoi 1 jaar geleden
bovenliggende
commit
5d302f3435
1 gewijzigde bestanden met toevoegingen van 2 en 14 verwijderingen
  1. 2 14
      src/net/session/inbound_session.rs

+ 2 - 14
src/net/session/inbound_session.rs

@@ -26,7 +26,7 @@
 use std::sync::{Arc, Weak};
 
 use async_trait::async_trait;
-use log::{debug, error, info, warn};
+use log::{error, info, warn};
 use smol::{lock::Mutex, Executor};
 use url::Url;
 
@@ -184,20 +184,8 @@ impl InboundSession {
             channel_id: channel.info.id,
         });
 
-        let stop_sub = channel.subscribe_stop().await;
-
         match self.register_channel(channel.clone(), ex.clone()).await {
-            Ok(()) => {
-                if let Ok(stop_sub) = stop_sub {
-                    // Wait for a stop signal, then cleanup.
-                    stop_sub.receive().await;
-
-                    debug!(
-                        target: "net::inbound_session::setup_channel()",
-                        "Received stop_sub, channel removed from P2P",
-                    );
-                }
-            }
+            Ok(()) => {}
             Err(e) => {
                 warn!(
                     target: "net::inbound_session::setup_channel()",