HDWallet passes along network type when it creates the master private key
This commit is contained in:
parent
36d3d6ebaa
commit
ff70f661f7
1 changed files with 2 additions and 1 deletions
|
@ -13,7 +13,8 @@ var HDWallet = module.exports = function(seed, network) {
|
||||||
|
|
||||||
var I = Crypto.HMAC(Crypto.SHA512, seed, 'Bitcoin seed', { asBytes: true })
|
var I = Crypto.HMAC(Crypto.SHA512, seed, 'Bitcoin seed', { asBytes: true })
|
||||||
this.chaincode = I.slice(32)
|
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.pub = this.priv.getPub()
|
||||||
this.network = network || 'Bitcoin'
|
this.network = network || 'Bitcoin'
|
||||||
this.index = 0
|
this.index = 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue