mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-18 08:22:16 +00:00
@@ -18664,6 +18664,8 @@ window.Entropy = new (function() {
|
||||
var phraseChangeTimeoutEvent = null;
|
||||
var rootKeyChangedTimeoutEvent = null;
|
||||
|
||||
var generationProcesses = [];
|
||||
|
||||
var DOM = {};
|
||||
DOM.network = $(".network");
|
||||
DOM.phraseNetwork = $("#network-phrase");
|
||||
@@ -19157,14 +19159,28 @@ window.Entropy = new (function() {
|
||||
}
|
||||
|
||||
function displayAddresses(start, total) {
|
||||
for (var i=0; i<total; i++) {
|
||||
var index = i + start;
|
||||
new TableRow(index);
|
||||
}
|
||||
generationProcesses.push(new (function() {
|
||||
|
||||
var rows = [];
|
||||
|
||||
this.stop = function() {
|
||||
for (var i=0; i<rows.length; i++) {
|
||||
rows[i].shouldGenerate = false;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i=0; i<total; i++) {
|
||||
var index = i + start;
|
||||
rows.push(new TableRow(index));
|
||||
}
|
||||
|
||||
})());
|
||||
}
|
||||
|
||||
function TableRow(index) {
|
||||
|
||||
var self = this;
|
||||
this.shouldGenerate = true;
|
||||
var useHardenedAddresses = DOM.hardenedAddresses.prop("checked");
|
||||
|
||||
function init() {
|
||||
@@ -19173,6 +19189,9 @@ window.Entropy = new (function() {
|
||||
|
||||
function calculateValues() {
|
||||
setTimeout(function() {
|
||||
if (!self.shouldGenerate) {
|
||||
return;
|
||||
}
|
||||
var key = "";
|
||||
if (useHardenedAddresses) {
|
||||
key = bip32ExtendedKey.deriveHardened(index);
|
||||
@@ -19223,6 +19242,14 @@ window.Entropy = new (function() {
|
||||
|
||||
function clearAddressesList() {
|
||||
DOM.addresses.empty();
|
||||
stopGenerating();
|
||||
}
|
||||
|
||||
function stopGenerating() {
|
||||
while (generationProcesses.length > 0) {
|
||||
var generation = generationProcesses.shift();
|
||||
generation.stop();
|
||||
}
|
||||
}
|
||||
|
||||
function clearKey() {
|
||||
|
||||
Reference in New Issue
Block a user