Validate root key correctly for alternate networks

This commit is contained in:
Ian Coleman
2017-09-01 12:27:03 +10:00
parent 0cda44d5f6
commit cd7c8327b1
+1 -2
View File
@@ -267,7 +267,6 @@
function rootKeyChanged() { function rootKeyChanged() {
showPending(); showPending();
hideValidationError(); hideValidationError();
// Validate the root key TODO
var rootKeyBase58 = DOM.rootKey.val(); var rootKeyBase58 = DOM.rootKey.val();
var errorText = validateRootKey(rootKeyBase58); var errorText = validateRootKey(rootKeyBase58);
if (errorText) { if (errorText) {
@@ -460,7 +459,7 @@
function validateRootKey(rootKeyBase58) { function validateRootKey(rootKeyBase58) {
try { try {
bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58); bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, network);
} }
catch (e) { catch (e) {
return "Invalid root key"; return "Invalid root key";