Allow to peers behind NAT to get up to preferred_max connections (#2543)

Allow to peers behind NAT to get up to preffered_max connections

If peer has only outbound connections it's mot likely behind NAT and we should not stop it from getting more outbound connections
This commit is contained in:
hashmap 2019-02-25 16:29:37 +01:00 committed by GitHub
parent eed81388d5
commit 224a315dd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -311,7 +311,7 @@ fn listen_for_addrs(
let addrs: Vec<PeerAddr> = rx.try_iter().collect(); let addrs: Vec<PeerAddr> = rx.try_iter().collect();
// If we have a healthy number of outbound peers then we are done here. // If we have a healthy number of outbound peers then we are done here.
if peers.healthy_peers_mix() { if peers.peer_count() > peers.peer_outbound_count() && peers.healthy_peers_mix() {
return; return;
} }