From 8a38a24b9fc2401b5d3f1783e69af793f2082ced Mon Sep 17 00:00:00 2001
From: Sjors Provoost <sjors@sprovoost.nl>
Date: Fri, 20 Feb 2015 17:16:47 -0500
Subject: [PATCH] Allow constructing HDNode from an ECPubKey.

---
 src/hdnode.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/hdnode.js b/src/hdnode.js
index e81dc4e..1fd50be 100644
--- a/src/hdnode.js
+++ b/src/hdnode.js
@@ -43,6 +43,8 @@ function HDNode(K, chainCode, network) {
   if (K instanceof BigInteger) {
     this.privKey = new ECKey(K, true)
     this.pubKey = this.privKey.pub
+  } else if (K instanceof ECPubKey) {
+    this.pubKey = K
   } else {
     this.pubKey = new ECPubKey(K, true)
   }