Просмотр исходного кода

net: these lines aren't needed. The enable/disable guard is simply for channel message logging. The other info is still accessible and adds no costs.

x 3 лет назад
Родитель
Сommit
977f3027ff
1 измененных файлов с 3 добавлено и 5 удалено
  1. 3 5
      src/net/p2p.rs

+ 3 - 5
src/net/p2p.rs

@@ -384,11 +384,9 @@ impl P2p {
     pub async fn dnet_info(&self) -> Vec<DnetInfo> {
         let mut ret = vec![];
 
-        if *self.dnet_enabled.lock().await {
-            ret.push(self.session_inbound().await.dnet_info().await);
-            ret.push(self.session_outbound().await.dnet_info().await);
-            ret.push(DnetInfo::Hosts(self.hosts.load_all().await));
-        }
+        ret.push(self.session_inbound().await.dnet_info().await);
+        ret.push(self.session_outbound().await.dnet_info().await);
+        ret.push(DnetInfo::Hosts(self.hosts.load_all().await));
 
         ret
     }