Przeglądaj źródła

protocol_address/seed: don't return if ping_node is false

this would mean that if the first external addr in our list is invalid
it will exit the function. instead, continue to check each addr, and if
they are all invalid just broadcast an empty vector inside the AddrsMessage.
lunar-mining 2 lat temu
rodzic
commit
7f3d43f538

+ 3 - 2
src/net/protocol/protocol_address.rs

@@ -200,8 +200,9 @@ impl ProtocolAddress {
                 let last_seen = UNIX_EPOCH.elapsed().unwrap().as_secs();
                 addrs.push((addr, last_seen));
             } else {
-                debug!(target: "net::protocol_address::send_my_addrs()", "Ping self failed");
-                return Ok(())
+                // Our external addr is invalid. If every external addr in the list is invalid
+                // we will just broadcast an empty AddrsMessage.
+                debug!(target: "net::protocol_address::send_my_addrs()", "Ping self failed!");
             }
         }
         debug!(target: "net::protocol_address::send_my_addrs()", "Broadcasting address");

+ 3 - 2
src/net/protocol/protocol_seed.rs

@@ -88,8 +88,9 @@ impl ProtocolSeed {
                 let last_seen = UNIX_EPOCH.elapsed().unwrap().as_secs();
                 addrs.push((addr, last_seen));
             } else {
-                debug!(target: "net::protocol_seed::send_my_addrs()", "Ping self failed");
-                return Ok(())
+                // Our external addr is invalid. If every external addr in the list is invalid
+                // we will just broadcast an empty AddrsMessage.
+                debug!(target: "net::protocol_seed::send_my_addrs()", "Ping self failed!");
             }
         }
         debug!(target: "net::protocol_seed::send_my_addrs()", "Broadcasting address");