Skip to content

Commit 49050f9

Browse files
committed
Merge pull request #366 from Sjors/hdnode
Allow constructing HDNode from an ECPubKey.
2 parents f87ac58 + 8a38a24 commit 49050f9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/hdnode.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ function HDNode(K, chainCode, network) {
4343
if (K instanceof BigInteger) {
4444
this.privKey = new ECKey(K, true)
4545
this.pubKey = this.privKey.pub
46+
} else if (K instanceof ECPubKey) {
47+
this.pubKey = K
4648
} else {
4749
this.pubKey = new ECPubKey(K, true)
4850
}

0 commit comments

Comments
 (0)