Skip to content

Commit

Permalink
BlockQueue: emit peers that are behind/ahead only once, #1388
Browse files Browse the repository at this point in the history
  • Loading branch information
styppo committed May 22, 2023
1 parent 88da409 commit 33e47f9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions consensus/src/sync/live/block_queue/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ impl<N: Network> BlockQueue<N> {
);
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 {
Expand All @@ -206,8 +205,7 @@ impl<N: Network> BlockQueue<N> {
);
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 {
Expand Down

0 comments on commit 33e47f9

Please sign in to comment.