executor is always notified about ignored getheaders

This commit is contained in:
debris 2016-11-16 12:12:22 +01:00
parent 8cc045c92b
commit 8ecfc9368d
1 changed files with 4 additions and 4 deletions

View File

@ -109,10 +109,10 @@ impl<T, U, V> LocalNode<T, U, V> 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