From: Matt Corallo Date: Mon, 3 Jun 2019 18:38:35 +0000 (-0400) Subject: Require some number of addrs to count, not just one X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=eab7aa919b970eaf32fe93ec4407750b2d2afdab;p=dnsseed-rust Require some number of addrs to count, not just one --- diff --git a/src/main.rs b/src/main.rs index 2c19c23..30c3635 100644 --- a/src/main.rs +++ b/src/main.rs @@ -138,15 +138,17 @@ pub fn scan_node(scan_time: Instant, node: SocketAddr, manual: bool) { state_lock.recvd_addrs = false; return future::err(()); } - if !state_lock.recvd_addrs { - if let Err(_) = write.try_send(NetworkMessage::GetData(vec![Inventory { - inv_type: InvType::WitnessBlock, - hash: state_lock.request.1, - }])) { - return future::err(()); + if addrs.len() > 10 { + if !state_lock.recvd_addrs { + if let Err(_) = write.try_send(NetworkMessage::GetData(vec![Inventory { + inv_type: InvType::WitnessBlock, + hash: state_lock.request.1, + }])) { + return future::err(()); + } } + state_lock.recvd_addrs = true; } - state_lock.recvd_addrs = true; unsafe { DATA_STORE.as_ref().unwrap() }.add_fresh_nodes(&addrs); }, NetworkMessage::Block(block) => {