aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriancoleman <1281387+iancoleman@users.noreply.github.com>2018-05-29 10:29:47 +1000
committerGitHub <noreply@github.com>2018-05-29 10:29:47 +1000
commitcbd0625ff7742ac5180b39139d2f6ee79730b934 (patch)
tree5b89b49f300f69b99129323adb3e93f475e2b8a0 /src
parentbd06face96847b483bb586de8f447f094b7926b0 (diff)
parent55b878d8d55639cea6d5cd0755194e0e768ba4de (diff)
downloadBIP39-cbd0625ff7742ac5180b39139d2f6ee79730b934.tar.gz
BIP39-cbd0625ff7742ac5180b39139d2f6ee79730b934.tar.zst
BIP39-cbd0625ff7742ac5180b39139d2f6ee79730b934.zip
Merge pull request #219 from cryptostorage/master
Fix incorrect address generation for altcoins with BIP38 enabled
Diffstat (limited to 'src')
-rw-r--r--src/js/index.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/js/index.js b/src/js/index.js
index 567a3f7..afa743d 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -813,7 +813,7 @@
813 var keyPair = key.keyPair; 813 var keyPair = key.keyPair;
814 var useUncompressed = useBip38; 814 var useUncompressed = useBip38;
815 if (useUncompressed) { 815 if (useUncompressed) {
816 keyPair = new bitcoinjs.bitcoin.ECPair(keyPair.d, null, { compressed: false }); 816 keyPair = new bitcoinjs.bitcoin.ECPair(keyPair.d, null, { network: network, compressed: false });
817 } 817 }
818 // get address 818 // get address
819 var address = keyPair.getAddress().toString(); 819 var address = keyPair.getAddress().toString();
@@ -821,7 +821,7 @@
821 var hasPrivkey = !key.isNeutered(); 821 var hasPrivkey = !key.isNeutered();
822 var privkey = "NA"; 822 var privkey = "NA";
823 if (hasPrivkey) { 823 if (hasPrivkey) {
824 privkey = keyPair.toWIF(network); 824 privkey = keyPair.toWIF();
825 // BIP38 encode private key if required 825 // BIP38 encode private key if required
826 if (useBip38) { 826 if (useBip38) {
827 privkey = bitcoinjsBip38.encrypt(keyPair.d.toBuffer(), false, bip38password, function(p) { 827 privkey = bitcoinjsBip38.encrypt(keyPair.d.toBuffer(), false, bip38password, function(p) {