From 8ecfc9368d915c2153907849c29fff608bb4783c Mon Sep 17 00:00:00 2001 From: debris Date: Wed, 16 Nov 2016 12:12:22 +0100 Subject: [PATCH] executor is always notified about ignored getheaders --- sync/src/local_node.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sync/src/local_node.rs b/sync/src/local_node.rs index 0cc10799..b9b00742 100644 --- a/sync/src/local_node.rs +++ b/sync/src/local_node.rs @@ -109,10 +109,10 @@ impl LocalNode where T: SynchronizationTaskExecutor + PeersCon trace!(target: "sync", "Got `getheaders` message from peer#{}", peer_index); // do not serve getheaders requests until we are synchronized - // TODO: uncomment this, and notify p2p module about ignored request - //if self.client.lock().state().is_synchronizing() { - //return; - //} + if self.client.lock().state().is_synchronizing() { + self.executor.lock().execute(SynchronizationTask::Ignore(peer_index, id)); + return; + } // simulating bitcoind for passing tests: if we are in nearly-saturated state // and peer, which has just provided a new blocks to us, is asking for headers