diff --git a/js/models/core/PrivateKey.js b/js/models/core/PrivateKey.js index 086f2561b..cc2a4d715 100644 --- a/js/models/core/PrivateKey.js +++ b/js/models/core/PrivateKey.js @@ -61,8 +61,11 @@ PrivateKey.prototype._getHK = function(path) { return this.bip.derive(path); }; -PrivateKey.prototype.get = function(index,isChange) { - var path = Structure.FullBranch(index, isChange); +PrivateKey.prototype.getForPaths = function(paths) { + return paths.map(this.getForPath.bind(this)); +}; + +PrivateKey.prototype.getForPath = function(path) { var pk = this.privateKeyCache[path]; if (!pk) { var derivedHK = this._getHK(path); @@ -73,6 +76,11 @@ PrivateKey.prototype.get = function(index,isChange) { return wk; }; +PrivateKey.prototype.get = function(index,isChange) { + var path = Structure.FullBranch(index, isChange); + return this.getForPath(path); +}; + PrivateKey.prototype.getAll = function(addressIndex, changeAddressIndex) { var ret = []; for(var i=0;i