diff --git a/lib/net/pool.js b/lib/net/pool.js index 19da4b49..c00e1ddb 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -518,13 +518,19 @@ Pool.prototype.discoverGateway = co(function* discoverGateway() { */ Pool.prototype.discoverSeeds = co(function* discoverSeeds(checkPeers) { - var total = 0; var max = Math.min(2, this.options.maxOutbound); var size = this.hosts.size(); + var total = 0; var peer; + if (this.hosts.dnsSeeds.length === 0) + return; + for (peer = this.peers.head(); peer; peer = peer.next) { - if (peer.handshake) { + if (!peer.outbound) + continue; + + if (peer.connected) { if (++total > max) break; }