y 2 лет назад
Родитель
Сommit
959981a7f6
1 измененных файлов с 3 добавлено и 8 удалено
  1. 3 8
      src/net/hosts.rs

+ 3 - 8
src/net/hosts.rs

@@ -99,7 +99,7 @@ impl Hosts {
         let mut ret = vec![];
         let mut ret = vec![];
         let localnet = self.settings.localnet;
         let localnet = self.settings.localnet;
 
 
-        for addr_ in addrs {
+        'addr_loop: for addr_ in addrs {
             // Validate that the format is `scheme://host_str:port`
             // Validate that the format is `scheme://host_str:port`
             if addr_.host_str().is_none() ||
             if addr_.host_str().is_none() ||
                 addr_.port().is_none() ||
                 addr_.port().is_none() ||
@@ -117,17 +117,12 @@ impl Hosts {
             let host_str = addr_.host_str().unwrap();
             let host_str = addr_.host_str().unwrap();
 
 
             if !localnet {
             if !localnet {
-                // Our own addresses should never enter the hosts set.
-                let mut got_own = false;
+                // Our own external addresses should never enter the hosts set.
                 for ext in &self.settings.external_addrs {
                 for ext in &self.settings.external_addrs {
                     if host_str == ext.host_str().unwrap() {
                     if host_str == ext.host_str().unwrap() {
-                        got_own = true;
-                        break
+                        continue 'addr_loop;
                     }
                     }
                 }
                 }
-                if got_own {
-                    continue
-                }
             }
             }
 
 
             // We do this hack in order to parse IPs properly.
             // We do this hack in order to parse IPs properly.