diff --git a/lib/bcoin/pool.js b/lib/bcoin/pool.js index 386e245f..847cc45b 100644 --- a/lib/bcoin/pool.js +++ b/lib/bcoin/pool.js @@ -1581,35 +1581,10 @@ Pool.prototype.usableSeed = function usableSeed(priority, connecting) { } } - // Try the rest of the peers second. - for (i = 0; i < seeds.length; i++) { - addr = seeds[i]; - assert(addr.host); - if (this.getPeer(addr)) - continue; - if (this.isMisbehaving(addr.host)) - continue; - return addr; - } - - // If we are a priority socket, try to find a - // peer this time with looser requirements. - if (priority) { - for (i = 0; i < seeds.length; i++) { - addr = seeds[i]; - assert(addr.host); - if (this.peers.load && this.getPeer(addr) === this.peers.load) - continue; - if (this.isMisbehaving(addr.host)) - continue; - return addr; - } - } - // If we have no block peers, always return // an address. if (!priority) { - if (all.length === 1) + if (connecting) return all[Math.random() * (all.length - 1) | 0]; }