|
|
@ -1,3 +1,13 @@ |
|
|
|
var chainActivationLastUpdate, |
|
|
|
chainActivationLastUpdateTimeout = 1; |
|
|
|
|
|
|
|
function checkTimestamp(dateToCheck) { |
|
|
|
var currentEpochTime = new Date(Date.now()) / 1000, |
|
|
|
secondsElapsed = Number(currentEpochTime) - Number(dateToCheck / 1000); |
|
|
|
|
|
|
|
return Math.floor(secondsElapsed); |
|
|
|
} |
|
|
|
|
|
|
|
function RunKMDInitFunctions() { |
|
|
|
NProgress.done(true); |
|
|
|
NProgress.configure({ |
|
|
@ -87,6 +97,7 @@ function RunKMDInitFunctions() { |
|
|
|
var currentBestBlockInterval; |
|
|
|
function startBestBlockInterval() { |
|
|
|
currentBestBlockInterval = setInterval(function() { |
|
|
|
if (!chainActivationLastUpdate || checkTimestamp(chainActivationLastUpdate) > chainActivationLastUpdateTimeout) { |
|
|
|
$.ajax({ |
|
|
|
type: 'POST', |
|
|
|
data: { |
|
|
@ -103,7 +114,7 @@ function RunKMDInitFunctions() { |
|
|
|
var currentBestChain = temp[i].replace('height=', ''); |
|
|
|
$('#activating-komodod-tridot').hide(); |
|
|
|
$('#activating-komodod-progress').html(': ' + Math.floor(currentBestChain * 100 / totalBlocksInExplorer) + '% (blocks ' + currentBestChain + ' / ' + totalBlocksInExplorer + ')'); |
|
|
|
|
|
|
|
chainActivationLastUpdate = Date.now(); |
|
|
|
if (currentBestChain === totalBlocksInExplorer) { |
|
|
|
//clearInterval(totalBlocksInExplorerInterval);
|
|
|
|
clearInterval(currentBestBlockInterval); |
|
|
@ -119,6 +130,7 @@ function RunKMDInitFunctions() { |
|
|
|
console.log(error); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, 2000); |
|
|
|
} |
|
|
|
|
|
|
|