put user agent in constants.

This commit is contained in:
Christopher Jeffrey 2015-12-20 01:57:47 -08:00
parent 93e42e90a1
commit f25d69f30f
2 changed files with 12 additions and 10 deletions

View File

@ -181,6 +181,15 @@ exports.rejectByVal = Object.keys(exports.reject).reduce(function(out, name) {
return out;
}, {});
exports.hd = {
hardened: 0x80000000,
maxIndex: 2 * 0x80000000,
minEntropy: 128 / 8,
maxEntropy: 512 / 8,
parentFingerPrintSize: 4,
pathRoots: ['m', 'M', 'm\'', 'M\'']
};
exports.locktimeThreshold = 500000000; // Tue Nov 5 00:53:20 1985 UTC
exports.oneHash = utils.toArray(
@ -193,11 +202,5 @@ exports.zeroHash = utils.toArray(
'hex'
);
exports.hd = {
hardened: 0x80000000,
maxIndex: 2 * 0x80000000,
minEntropy: 128 / 8,
maxEntropy: 512 / 8,
parentFingerPrintSize: 4,
pathRoots: ['m', 'M', 'm\'', 'M\'']
};
exports.userVersion = require('../../../package.json').version;
exports.userAgent = '/bcoin:' + exports.userVersion + '/';

View File

@ -9,7 +9,6 @@ var network = require('./network');
var constants = require('./constants');
var utils = bcoin.utils;
var assert = utils.assert;
var version = require('../../../package.json').version;
var writeU32 = utils.writeU32;
var writeAscii = utils.writeAscii;
@ -26,7 +25,7 @@ function Framer(options) {
this.options = options;
this.agent = utils.toArray(options.agent || '/bcoin:' + version + '/');
this.agent = utils.toArray(options.userAgent || constants.userAgent);
this.agent = this.agent.slice(0, 0xfc);
}