Skip to content

Commit

Permalink
fix: seek peers until we have 20 outgoing (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler authored Dec 5, 2024
1 parent 9be9a52 commit e4b1c25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/p2p/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,10 @@ where S: ShareChain
_ = seek_connections_interval.tick() => {
let timer = Instant::now();
if !self.config.is_seed_peer {
if self.swarm.connected_peers().count() > 20 {
let info = self.swarm.network_info();
let counters = info.connection_counters();

if (counters.num_established_outgoing() + counters.num_pending_outgoing()) > 20 {
continue;
}
let mut num_dialed = 0;
Expand Down

0 comments on commit e4b1c25

Please sign in to comment.