From 5f646d85f173e2274d12765633a5b6b21450b7d3 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 20 May 2019 21:06:15 -0400 Subject: [PATCH] Request block after addr recv, print subver on bad services --- src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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); }, -- 2.39.5