From: Matt Corallo Date: Tue, 21 May 2019 01:06:15 +0000 (-0400) Subject: Request block after addr recv, print subver on bad services X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=5f646d85f173e2274d12765633a5b6b21450b7d3;p=dnsseed-rust Request block after addr recv, print subver on bad services --- diff --git a/src/main.rs b/src/main.rs index dd87140..5fd0c1a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,7 +102,7 @@ pub fn scan_node(scan_time: Instant, node: SocketAddr) { return future::err(()); } if ver.services & (1 | (1 << 10)) == 0 { - printer.add_line(format!("Updating {} to NotFullNode (services {:x})", node, ver.services), true); + printer.add_line(format!("Updating {} to NotFullNode ({}: services {:x})", node, ver.user_agent, ver.services), true); state_lock.fail_reason = AddressState::NotFullNode; return future::err(()); } @@ -122,12 +122,6 @@ pub fn scan_node(scan_time: Instant, node: SocketAddr) { if let Err(_) = write.try_send(NetworkMessage::GetAddr) { return future::err(()); } - if let Err(_) = write.try_send(NetworkMessage::GetData(vec![Inventory { - inv_type: InvType::WitnessBlock, - hash: state_lock.request.1, - }])) { - return future::err(()); - } }, NetworkMessage::Ping(v) => { if let Err(_) = write.try_send(NetworkMessage::Pong(v)) { @@ -141,6 +135,12 @@ pub fn scan_node(scan_time: Instant, node: SocketAddr) { state_lock.recvd_addrs = false; return future::err(()); } + 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; unsafe { DATA_STORE.as_ref().unwrap() }.add_fresh_nodes(&addrs); },