Skip to content

Commit c7e003b

Browse files
authored
Merge pull request #66 from go-faast/undefined-bip32
Fix undefined bip32 error calling toBitcoinJS and toBitcore
2 parents 85cbb00 + 1d50880 commit c7e003b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/coininfo.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ function toBitcoinJS () {
6868
return Object.assign({}, this, {
6969
messagePrefix: this.versions.messagePrefix || ('\x19' + this.versions.name + ' Signed Message:\n'),
7070
bip32: {
71-
public: this.versions.bip32.public,
72-
private: this.versions.bip32.private
71+
public: (this.versions.bip32 || {}).public,
72+
private: (this.versions.bip32 || {}).private
7373
},
7474
pubKeyHash: this.versions.public,
7575
scriptHash: this.versions.scripthash,
@@ -90,8 +90,8 @@ function toBitcore () {
9090
pubkeyhash: this.versions.public,
9191
privatekey: this.versions.private,
9292
scripthash: this.versions.scripthash,
93-
xpubkey: this.versions.bip32.public,
94-
xprivkey: this.versions.bip32.private,
93+
xpubkey: (this.versions.bip32 || {}).public,
94+
xprivkey: (this.versions.bip32 || {}).private,
9595
networkMagic: nm,
9696
port: this.port,
9797
dnsSeeds: this.seedsDns || []

0 commit comments

Comments
 (0)