diff --git a/lib/net/pool.js b/lib/net/pool.js index 47a09330..579eeca0 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -396,7 +396,8 @@ Pool.prototype._connect = co(function* connect() { this.logger.info('External IP found: %s.', ip); } - yield this.hosts.discover(); + // Try to get 16 hosts for now. + yield this.hosts.discover(16); if (this.hosts.size() === 0) throw new Error('No hosts available. Do you have an internet connection?'); @@ -1565,10 +1566,10 @@ Pool.prototype._fillPeers = co(function* fillPeers() { this.peers.outbound, this.maxOutbound); - if (this.hosts.size() < need) { + if (this.hosts.size() < need && need < 10) { this.logger.warning('Very few hosts available.'); this.logger.warning('Hitting DNS seeds again.'); - yield this.hosts.discover(30); + yield this.hosts.discover(); } for (i = 0; i < need; i++) @@ -2346,7 +2347,7 @@ HostList.prototype.discover = co(function* discover(max) { var i, seed; if (!max) - max = 16; + max = Infinity; for (i = 0; i < this.seeds.length; i++) { seed = this.seeds[i];