add master key reference to hd keys.

This commit is contained in:
Christopher Jeffrey 2015-12-10 17:54:15 -08:00
parent 243d3fd69f
commit bb9974b818

View File

@ -151,6 +151,8 @@ function HDPriv(options) {
data = options;
}
this.master = options.master || this;
data = this._normalize(data, network.prefixes.xprivkey);
this.data = data;
@ -323,6 +325,7 @@ HDPriv.prototype.derive = function(index, hard) {
var privateKey = leftPart.add(new bn(this.privateKey)).mod(ec.curve.n).toArray();
return new HDPriv({
master: this.master,
// version: this.version,
depth: this.depth + 1,
parentFingerPrint: this.fingerPrint,