pool: fix discoverSeeds.

This commit is contained in:
Christopher Jeffrey 2017-03-07 22:41:13 -08:00
parent 19525826e3
commit 75f4e9616f
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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;
}