From 75f4e9616f8eff6d917ae27fa170b05c99ca8816 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 7 Mar 2017 22:41:13 -0800 Subject: [PATCH] pool: fix discoverSeeds. --- lib/net/pool.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; }