Skip to content

Prevent continuous searches for low-peer networks #6162

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions beacon_node/lighthouse_network/src/peer_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,11 @@ impl<E: EthSpec> PeerManager<E> {
self.max_peers().saturating_sub(dialing_peers) - peer_count
} else if outbound_only_peer_count < self.min_outbound_only_peers()
&& peer_count < self.max_outbound_dialing_peers()
&& self.target_peers > 10
// This condition is to attempt to exclude testnets without
// an explicit CLI flag. For networks with low peer counts, we don't want to do
// repetitive searches for outbound peers, when we may be already connected to every
// peer on the testnet
{
self.max_outbound_dialing_peers()
.saturating_sub(dialing_peers)
Expand Down
Loading