HDWallet passes along network type when it creates the master private key

This commit is contained in:
xnova 2014-02-27 01:18:56 -05:00
parent 36d3d6ebaa
commit ff70f661f7

View file

@ -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