diff --git a/lib/net/pool.js b/lib/net/pool.js index c601e5ca..65c9c7a2 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -1568,7 +1568,7 @@ Pool.prototype._fillPeers = co(function* fillPeers() { if (this.hosts.size() < need) { this.logger.warning('Very few hosts available.'); this.logger.warning('Hitting DNS seeds again.'); - yield this.hosts.discover(this.maxOutbound * 4); + yield this.hosts.discover(30); } for (i = 0; i < need; i++) @@ -2338,21 +2338,22 @@ HostList.prototype.addSeed = function addSeed(hostname) { /** * Discover hosts from seeds. + * @param {Number?} max * @returns {Promise} */ -HostList.prototype.discover = co(function* discover(total) { +HostList.prototype.discover = co(function* discover(max) { var i, seed; - if (!total) - total = 16; + if (!max) + max = 16; for (i = 0; i < this.seeds.length; i++) { seed = this.seeds[i]; yield this.populate(seed); - if (this.list.size >= total) + if (this.list.size >= max) break; } });