mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-26 04:10:40 +00:00
Validate root key correctly for alternate networks
This commit is contained in:
+1
-2
@@ -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";
|
||||||
|
|||||||
Reference in New Issue
Block a user