Bläddra i källkod

chore: remove lingering merge artifact + cargo fmt

draoi 2 år sedan
förälder
incheckning
fe18477578
2 ändrade filer med 1 tillägg och 23 borttagningar
  1. 1 1
      src/net/channel.rs
  2. 0 22
      src/net/hosts/store.rs

+ 1 - 1
src/net/channel.rs

@@ -37,11 +37,11 @@ use url::Url;
 
 use super::{
     dnet::{self, dnetev, DnetEvent},
+    hosts::store::HostColor,
     message,
     message::Packet,
     message_subscriber::{MessageSubscription, MessageSubsystem},
     p2p::P2pPtr,
-    hosts::store::HostColor,
     session::{Session, SessionBitFlag, SessionWeakPtr},
     transport::PtStream,
 };

+ 0 - 22
src/net/hosts/store.rs

@@ -1014,28 +1014,6 @@ impl Hosts {
             q.insert(addr.clone(), 0);
         }
     }
-
-    /// Mark a peer as blacklist.
-    pub async fn blacklist(&self, peer: &Url) {
-        // We ignore UNIX sockets here so we will just work
-        // with stuff that has host_str().
-        if peer.host_str().is_some() {
-            // Localhost connections should never enter the blacklist
-            // This however allows any Tor and Nym connections.
-            if self.is_local_host(peer.clone()).await {
-                return
-            }
-
-            // Insert into the blacklist. We set last_seen to 0 (we don't care about this
-            // field).
-            self.container.hostlists[HostColor::Black as usize]
-                .write()
-                .await
-                .push((peer.clone(), 0));
-        }
-    }
-=======
->>>>>>> 8aad26601 (net: replace downgrade() and update(), and blacklist methods with a single method move_hosts())
 }
 
 #[cfg(test)]