http: fix require.

This commit is contained in:
Christopher Jeffrey 2016-08-24 05:21:05 -07:00
parent 8c00722dda
commit f7b61278d0
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
3 changed files with 15 additions and 3 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);