aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2017-09-01 12:27:03 +1000
committerIan Coleman <coleman.ian@gmail.com>2017-09-01 12:27:03 +1000
commitcd7c8327b110ee2fc2010d1e88f5009f859cd981 (patch)
tree8895f31d52eb2fc60a2e25d9a0c16795c2a0602c
parent0cda44d5f6ca63520ad39e88771c374da2993d6c (diff)
downloadBIP39-cd7c8327b110ee2fc2010d1e88f5009f859cd981.tar.gz
BIP39-cd7c8327b110ee2fc2010d1e88f5009f859cd981.tar.zst
BIP39-cd7c8327b110ee2fc2010d1e88f5009f859cd981.zip
Validate root key correctly for alternate networks
-rw-r--r--src/js/index.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/js/index.js b/src/js/index.js
index 45c7cb1..80e6609 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -267,7 +267,6 @@
267 function rootKeyChanged() { 267 function rootKeyChanged() {
268 showPending(); 268 showPending();
269 hideValidationError(); 269 hideValidationError();
270 // Validate the root key TODO
271 var rootKeyBase58 = DOM.rootKey.val(); 270 var rootKeyBase58 = DOM.rootKey.val();
272 var errorText = validateRootKey(rootKeyBase58); 271 var errorText = validateRootKey(rootKeyBase58);
273 if (errorText) { 272 if (errorText) {
@@ -460,7 +459,7 @@
460 459
461 function validateRootKey(rootKeyBase58) { 460 function validateRootKey(rootKeyBase58) {
462 try { 461 try {
463 bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58); 462 bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, network);
464 } 463 }
465 catch (e) { 464 catch (e) {
466 return "Invalid root key"; 465 return "Invalid root key";