do not close connection on notfound if not synchronizing

This commit is contained in:
Svyatoslav Nikolsky 2017-08-11 11:27:31 +03:00
parent 28f4cda92d
commit b33e327d32
1 changed files with 3 additions and 1 deletions

View File

@ -490,7 +490,9 @@ impl<T> ClientCore for SynchronizationClientCore<T> where T: TaskExecutor {
// for now, let's exclude peer from synchronization - we are relying on full nodes for synchronization
let removed_tasks = self.peers_tasks.reset_blocks_tasks(peer_index);
self.peers_tasks.unuseful_peer(peer_index);
self.peers.misbehaving(peer_index, &format!("Responded with NotFound(unrequested_block)"));
if self.state.is_synchronizing() {
self.peers.misbehaving(peer_index, &format!("Responded with NotFound(unrequested_block)"));
}
// if peer has had some blocks tasks, rerequest these blocks
self.execute_synchronization_tasks(Some(removed_tasks), None);