|
|
@ -423,14 +423,29 @@ HDPrivateKey.prototype._buildFromBuffers = function(arg) { |
|
|
|
fingerPrint: fingerPrint |
|
|
|
}); |
|
|
|
|
|
|
|
var HDPublicKey = require('./hdpublickey'); |
|
|
|
var hdPublicKey = new HDPublicKey(this); |
|
|
|
|
|
|
|
JSUtil.defineImmutable(this, { |
|
|
|
hdPublicKey: hdPublicKey, |
|
|
|
xpubkey: hdPublicKey.xpubkey |
|
|
|
this._hdPublicKey = null; |
|
|
|
Object.defineProperty(this, 'hdPublicKey', { |
|
|
|
configurable: false, |
|
|
|
enumerable: true, |
|
|
|
get: function() { |
|
|
|
if (!this._hdPublicKey) { |
|
|
|
var HDPublicKey = require('./hdpublickey'); |
|
|
|
this._hdPublicKey = new HDPublicKey(this); |
|
|
|
} |
|
|
|
return this._hdPublicKey; |
|
|
|
} |
|
|
|
}); |
|
|
|
Object.defineProperty(this, 'xpubkey', { |
|
|
|
configurable: false, |
|
|
|
enumerable: true, |
|
|
|
get: function() { |
|
|
|
if (!this._hdPublicKey) { |
|
|
|
var HDPublicKey = require('./hdpublickey'); |
|
|
|
this._hdPublicKey = new HDPublicKey(this); |
|
|
|
} |
|
|
|
return this._hdPublicKey.xpubkey; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
return this; |
|
|
|
}; |
|
|
|
|
|
|
|