diff --git a/consensus/src/sync/live/block_queue/mod.rs b/consensus/src/sync/live/block_queue/mod.rs index c9df7b282e..5fce9600e9 100644 --- a/consensus/src/sync/live/block_queue/mod.rs +++ b/consensus/src/sync/live/block_queue/mod.rs @@ -188,8 +188,7 @@ impl BlockQueue { ); self.report_validation_result(pubsub_id, MsgAcceptance::Ignore); - if self.network.has_peer(peer_id) { - self.request_component.take_peer(&peer_id); + if self.request_component.take_peer(&peer_id).is_some() { return Some(QueuedBlock::TooFarBehind(block, peer_id)); } } else if parent_known { @@ -206,8 +205,7 @@ impl BlockQueue { ); self.report_validation_result(pubsub_id, MsgAcceptance::Ignore); - if self.network.has_peer(peer_id) { - self.request_component.take_peer(&peer_id); + if self.request_component.take_peer(&peer_id).is_some() { return Some(QueuedBlock::TooFarAhead(block, peer_id)); } } else if self.buffer.len() >= self.config.buffer_max {