mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-03 09:47:38 +00:00
Do not send regular status updates during syncing (#1375)
This commit is contained in:
parent
2870172e0d
commit
f61a7113ac
@ -714,16 +714,20 @@ impl<TSpec: EthSpec> Stream for PeerManager<TSpec> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loop {
|
// We don't want to update peers during syncing, since this may result in a new chain being
|
||||||
match self.status_peers.poll_next_unpin(cx) {
|
// synced which leads to inefficient re-downloads of blocks.
|
||||||
Poll::Ready(Some(Ok(peer_id))) => {
|
if !self.network_globals.is_syncing() {
|
||||||
self.status_peers.insert(peer_id.clone());
|
loop {
|
||||||
self.events.push(PeerManagerEvent::Status(peer_id))
|
match self.status_peers.poll_next_unpin(cx) {
|
||||||
|
Poll::Ready(Some(Ok(peer_id))) => {
|
||||||
|
self.status_peers.insert(peer_id.clone());
|
||||||
|
self.events.push(PeerManagerEvent::Status(peer_id))
|
||||||
|
}
|
||||||
|
Poll::Ready(Some(Err(e))) => {
|
||||||
|
error!(self.log, "Failed to check for peers to ping"; "error" => e.to_string())
|
||||||
|
}
|
||||||
|
Poll::Ready(None) | Poll::Pending => break,
|
||||||
}
|
}
|
||||||
Poll::Ready(Some(Err(e))) => {
|
|
||||||
error!(self.log, "Failed to check for peers to ping"; "error" => e.to_string())
|
|
||||||
}
|
|
||||||
Poll::Ready(None) | Poll::Pending => break,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user