hd: minor fixes.

This commit is contained in:
Christopher Jeffrey 2016-10-04 02:22:20 -07:00
parent 08c7136ef4
commit ee4014a12f
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
3 changed files with 4 additions and 7 deletions

View File

@ -7,7 +7,6 @@
'use strict';
var utils = require('../utils/utils');
var LRU = require('../utils/lru');
var crypto = require('../crypto/crypto');
var ec = require('../crypto/ec');
var assert = require('assert');
@ -191,7 +190,7 @@ HDPrivateKey.prototype.destroy = function destroy(pub) {
HDPrivateKey.prototype.derive = function derive(index, hardened, cache) {
var p, id, data, hash, left, right, key, child;
if (hardened instanceof LRU) {
if (typeof hardened !== 'boolean') {
cache = hardened;
hardened = false;
}
@ -240,7 +239,7 @@ HDPrivateKey.prototype.derive = function derive(index, hardened, cache) {
try {
key = ec.privateKeyTweakAdd(this.privateKey, left);
} catch (e) {
return this.derive(index + 1);
return this.derive(index + 1, cache);
}
if (!this.fingerPrint)

View File

@ -7,7 +7,6 @@
'use strict';
var utils = require('../utils/utils');
var LRU = require('../utils/lru');
var crypto = require('../crypto/crypto');
var ec = require('../crypto/ec');
var assert = require('assert');
@ -144,7 +143,7 @@ HDPublicKey.prototype.destroy = function destroy() {
HDPublicKey.prototype.derive = function derive(index, hardened, cache) {
var p, id, data, hash, left, right, key, child;
if (hardened instanceof LRU) {
if (typeof hardened !== 'boolean') {
cache = hardened;
hardened = false;
}
@ -183,7 +182,7 @@ HDPublicKey.prototype.derive = function derive(index, hardened, cache) {
try {
key = ec.publicKeyTweakAdd(this.publicKey, left, true);
} catch (e) {
return this.derive(index + 1);
return this.derive(index + 1, cache);
}
if (!this.fingerPrint)

View File

@ -413,7 +413,6 @@ Wallet.prototype._encrypt = co(function* encrypt(passphrase) {
yield this.commit();
});
/**
* Decrypt the wallet permanently.
* @param {String|Buffer} passphrase