From f7b61278d08713f03ae48492a92822c553b26c41 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 24 Aug 2016 05:21:05 -0700 Subject: [PATCH] http: fix require. --- lib/http/rpc.js | 2 +- lib/http/wallet.js | 4 ++-- lib/net/pool.js | 12 ++++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/http/rpc.js b/lib/http/rpc.js index fb913b8f..6a36168f 100644 --- a/lib/http/rpc.js +++ b/lib/http/rpc.js @@ -8,7 +8,7 @@ var bcoin = require('../env'); var utils = require('../utils/utils'); -var IP = require('../ip'); +var IP = require('../utils/ip'); var assert = utils.assert; var constants = bcoin.constants; var fs; diff --git a/lib/http/wallet.js b/lib/http/wallet.js index 3b1ee5b0..4645758f 100644 --- a/lib/http/wallet.js +++ b/lib/http/wallet.js @@ -11,7 +11,7 @@ var Network = require('../protocol/network'); var EventEmitter = require('events').EventEmitter; var utils = require('../utils/utils'); -var http = require('./'); +var Client = require('./client'); /** * HTTPWallet @@ -35,7 +35,7 @@ function HTTPWallet(options) { this.options = options; this.network = Network.get(options.network); - this.client = new http.client(options); + this.client = new Client(options); this.uri = options.uri; this.id = null; this.token = null; diff --git a/lib/net/pool.js b/lib/net/pool.js index 26f1f0e5..04048877 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -2017,6 +2017,8 @@ function HostList(pool) { // Misbehaving hosts this.misbehaving = {}; + + this.setSeeds(this.pool.network.seeds); } /** @@ -2222,6 +2224,11 @@ HostList.prototype.isIgnored = function isIgnored(host) { return this.ignored[host] === true; }; +/** + * Set initial seeds. + * @param {String[]} seeds + */ + HostList.prototype.setSeeds = function setSeeds(seeds) { var i, hostname, seed; @@ -2234,6 +2241,11 @@ HostList.prototype.setSeeds = function setSeeds(seeds) { } }; +/** + * Add a preferred seed. + * @param {String} hostname + */ + HostList.prototype.addSeed = function addSeed(hostname) { var seed = NetworkAddress.fromHostname(hostname, this.pool.network); this.seeds.unshift(seed);