Skip to content

Commit

Permalink
Add restrictions on the candidate peers set
Browse files Browse the repository at this point in the history
  • Loading branch information
howardwu committed Dec 2, 2021
1 parent 9cfbf2a commit 33d8147
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/network/peers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,10 @@ impl<N: Network, E: Environment> Peers<N, E> {
};

// Add the sync nodes to the list of candidate peers.
let sync_nodes: Vec<SocketAddr> = E::SYNC_NODES.iter().map(|ip| ip.parse().unwrap()).collect();
self.add_candidate_peers(&sync_nodes).await;
if number_of_connected_sync_nodes == 0 {
let sync_nodes: Vec<SocketAddr> = E::SYNC_NODES.iter().map(|ip| ip.parse().unwrap()).collect();
self.add_candidate_peers(&sync_nodes).await;
}

// Add the beacon nodes to the list of candidate peers.
let beacon_nodes: Vec<SocketAddr> = E::BEACON_NODES.iter().map(|ip| ip.parse().unwrap()).collect();
Expand Down

0 comments on commit 33d8147

Please sign in to comment.