mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-19 17:02:16 +00:00
Extended Key calculation does not use global var
This commit is contained in:
@@ -238,7 +238,7 @@
|
|||||||
showValidationError(errorText);
|
showValidationError(errorText);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
calcBip32ExtendedKey(derivationPath);
|
bip32ExtendedKey = calcBip32ExtendedKey(derivationPath);
|
||||||
displayBip32Info();
|
displayBip32Info();
|
||||||
hidePending();
|
hidePending();
|
||||||
}
|
}
|
||||||
@@ -318,7 +318,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function calcBip32ExtendedKey(path) {
|
function calcBip32ExtendedKey(path) {
|
||||||
bip32ExtendedKey = bip32RootKey;
|
var extendedKey = bip32RootKey;
|
||||||
// Derive the key from the path
|
// Derive the key from the path
|
||||||
var pathBits = path.split("/");
|
var pathBits = path.split("/");
|
||||||
for (var i=0; i<pathBits.length; i++) {
|
for (var i=0; i<pathBits.length; i++) {
|
||||||
@@ -329,12 +329,13 @@
|
|||||||
}
|
}
|
||||||
var hardened = bit[bit.length-1] == "'";
|
var hardened = bit[bit.length-1] == "'";
|
||||||
if (hardened) {
|
if (hardened) {
|
||||||
bip32ExtendedKey = bip32ExtendedKey.deriveHardened(index);
|
extendedKey = extendedKey.deriveHardened(index);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bip32ExtendedKey = bip32ExtendedKey.derive(index);
|
extendedKey = extendedKey.derive(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return extendedKey
|
||||||
}
|
}
|
||||||
|
|
||||||
function showValidationError(errorText) {
|
function showValidationError(errorText) {
|
||||||
|
|||||||
Reference in New Issue
Block a user