Allow constructing HDNode from an ECPubKey.

This commit is contained in:
Sjors Provoost 2015-02-20 17:16:47 -05:00
parent e0b1aa843e
commit 8a38a24b9f

View file

@ -43,6 +43,8 @@ function HDNode(K, chainCode, network) {
if (K instanceof BigInteger) { if (K instanceof BigInteger) {
this.privKey = new ECKey(K, true) this.privKey = new ECKey(K, true)
this.pubKey = this.privKey.pub this.pubKey = this.privKey.pub
} else if (K instanceof ECPubKey) {
this.pubKey = K
} else { } else {
this.pubKey = new ECPubKey(K, true) this.pubKey = new ECPubKey(K, true)
} }