Do not send regular status updates during syncing (#1375)
This commit is contained in:
parent
2870172e0d
commit
f61a7113ac
@ -714,6 +714,9 @@ impl<TSpec: EthSpec> Stream for PeerManager<TSpec> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We don't want to update peers during syncing, since this may result in a new chain being
|
||||||
|
// synced which leads to inefficient re-downloads of blocks.
|
||||||
|
if !self.network_globals.is_syncing() {
|
||||||
loop {
|
loop {
|
||||||
match self.status_peers.poll_next_unpin(cx) {
|
match self.status_peers.poll_next_unpin(cx) {
|
||||||
Poll::Ready(Some(Ok(peer_id))) => {
|
Poll::Ready(Some(Ok(peer_id))) => {
|
||||||
@ -726,6 +729,7 @@ impl<TSpec: EthSpec> Stream for PeerManager<TSpec> {
|
|||||||
Poll::Ready(None) | Poll::Pending => break,
|
Poll::Ready(None) | Poll::Pending => break,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if !self.events.is_empty() {
|
if !self.events.is_empty() {
|
||||||
return Poll::Ready(Some(self.events.remove(0)));
|
return Poll::Ready(Some(self.events.remove(0)));
|
||||||
|
Loading…
Reference in New Issue
Block a user