This commit is contained in:
yggverse 2025-08-16 19:16:20 +03:00
parent 4d1455d34e
commit 08436591f6

View file

@ -44,24 +44,24 @@ fn main() -> Result<()> {
match p.response { match p.response {
Some(response) => { Some(response) => {
for peer in response.peers { for peer in response.peers {
crawl(peer.key, &config, &mut ygg, &mut key, &mut tcp, &mut udp)?; crawl(peer.key, &config, &mut ygg, &mut key, &mut tcp, &mut udp)?
} }
} }
None => println!("node has no peers to connect."), None => println!("node has no peers to connect."),
} }
println!("operation completed!"); println!("operation completed!");
if !key.is_empty() { if !key.is_empty() {
println!("\tkeys crawled: {}", key.len()); println!("\tkeys crawled: {}", key.len())
} }
if let Some(tcp) = tcp { if let Some(tcp) = tcp {
println!("\tTCP: {}", tcp.len()); println!("\tTCP: {}", tcp.len());
println!("\t\tfound: {}", tcp.values().filter(|v| **v).count()); println!("\t\tfound: {}", tcp.values().filter(|v| **v).count());
println!("\t\ttotal: {}", tcp.len()); println!("\t\ttotal: {}", tcp.len())
} }
if let Some((udp, _)) = udp { if let Some((udp, _)) = udp {
println!("\tUDP: {}", udp.len()); println!("\tUDP: {}", udp.len());
println!("\t\tfound: {}", udp.values().filter(|v| **v).count()); println!("\t\tfound: {}", udp.values().filter(|v| **v).count());
println!("\t\ttotal: {}", udp.len()); println!("\t\ttotal: {}", udp.len())
} }
Ok(()) Ok(())
} }
@ -117,7 +117,7 @@ fn crawl(
if let Some(l) = config.latency { if let Some(l) = config.latency {
std::thread::sleep(Duration::from_secs(l)) std::thread::sleep(Duration::from_secs(l))
} }
crawl(k, config, ygg, key, tcp, udp)?; crawl(k, config, ygg, key, tcp, udp)?
} }
} }
} }