From cedde2e9ec34a009686fee1f61829d8a2e974077 Mon Sep 17 00:00:00 2001 From: draoi Date: Fri, 12 Jul 2024 10:39:54 +0200 Subject: [PATCH] hosts: don't allow manual peers to enter the hostlist via other peers Storing manual peers on the hostlist creates redundancy since we can never connect to them in Outbound Session or refine them in Refine Session, so they just pointlessly sit on our greylist forever. --- src/net/hosts.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/net/hosts.rs b/src/net/hosts.rs index f505a5869..78ea29098 100644 --- a/src/net/hosts.rs +++ b/src/net/hosts.rs @@ -1142,6 +1142,15 @@ impl Hosts { continue } + // Configured peers should not enter the hostlist. + if settings.peers.contains(addr_) { + debug!( + target: "net::hosts::filter_addresses", + "[{}] is a configured peer. Skipping", addr_, + ); + continue + } + // Blacklist peers should never enter the hostlist. if self.container.contains(HostColor::Black as usize, addr_) || self.block_all_ports(addr_.host_str().unwrap().to_string())