include derivation path in tx proposal

This commit is contained in:
Manuel Araoz 2014-05-30 15:07:52 -03:00
commit 6af9ee68e2
4 changed files with 33 additions and 7 deletions

View file

@ -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<addressIndex; i++) {