浏览代码

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.
draoi 2 年之前
父节点
当前提交
cedde2e9ec
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/net/hosts.rs

+ 9 - 0
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())