more hd optimization.

This commit is contained in:
Christopher Jeffrey 2016-02-23 13:22:00 -08:00
parent 00eba20c4e
commit aadb1fb4e0

View File

@ -619,7 +619,7 @@ HDPrivateKey.prototype._generate = function _generate(privateKey, entropy) {
if (utils.isHex(privateKey))
privateKey = new Buffer(privateKey, 'hex');
else if (utils.isBase58(privateKey))
privateKey = bcoin.keypair.fromSecret(privateKey).getPrivateKey();
privateKey = bcoin.keypair._fromSecret(privateKey).privateKey;
if (!entropy)
entropy = new Buffer(elliptic.rand(32));
@ -689,7 +689,6 @@ HDPrivateKey.prototype._build = function _build(data) {
xprivkey = utils.toBase58(sequence);
key = bcoin.keypair({ privateKey: data.privateKey });
privateKey = key.getPrivateKey();
publicKey = key.getPublicKey();
size = constants.hd.parentFingerPrintSize;
@ -700,7 +699,7 @@ HDPrivateKey.prototype._build = function _build(data) {
this.parentFingerPrint = data.parentFingerPrint;
this.childIndex = data.childIndex;
this.chainCode = data.chainCode;
this.privateKey = privateKey;
this.privateKey = data.privateKey;
this.checksum = null;
this.xprivkey = xprivkey;