From ff70f661f7ed36298bb63edb724216db878e2c5a Mon Sep 17 00:00:00 2001
From: xnova <xnova@bitmessage.ch>
Date: Thu, 27 Feb 2014 01:18:56 -0500
Subject: [PATCH] HDWallet passes along network type when it creates the master
 private key

---
 src/hdwallet.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/hdwallet.js b/src/hdwallet.js
index 00a02c0..e653b71 100644
--- a/src/hdwallet.js
+++ b/src/hdwallet.js
@@ -13,7 +13,8 @@ var HDWallet = module.exports = function(seed, network) {
 
     var I = Crypto.HMAC(Crypto.SHA512, seed, 'Bitcoin seed', { asBytes: true })
     this.chaincode = I.slice(32)
-    this.priv = new ECKey(I.slice(0, 32).concat([1]), true)
+    this.priv = new ECKey(I.slice(0, 32).concat([1]), true,
+        network == 'Bitcoin' ? Address.address_types.prod : Address.address_types.testnet)
     this.pub = this.priv.getPub()
     this.network = network || 'Bitcoin'
     this.index = 0