pool: fix discoverSeeds.
This commit is contained in:
parent
19525826e3
commit
75f4e9616f
@ -518,13 +518,19 @@ Pool.prototype.discoverGateway = co(function* discoverGateway() {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Pool.prototype.discoverSeeds = co(function* discoverSeeds(checkPeers) {
|
Pool.prototype.discoverSeeds = co(function* discoverSeeds(checkPeers) {
|
||||||
var total = 0;
|
|
||||||
var max = Math.min(2, this.options.maxOutbound);
|
var max = Math.min(2, this.options.maxOutbound);
|
||||||
var size = this.hosts.size();
|
var size = this.hosts.size();
|
||||||
|
var total = 0;
|
||||||
var peer;
|
var peer;
|
||||||
|
|
||||||
|
if (this.hosts.dnsSeeds.length === 0)
|
||||||
|
return;
|
||||||
|
|
||||||
for (peer = this.peers.head(); peer; peer = peer.next) {
|
for (peer = this.peers.head(); peer; peer = peer.next) {
|
||||||
if (peer.handshake) {
|
if (!peer.outbound)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (peer.connected) {
|
||||||
if (++total > max)
|
if (++total > max)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user