mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-03-13 05:51:03 +00:00
shaping
This commit is contained in:
parent
16da1c8e31
commit
4637c68df7
@ -171,31 +171,31 @@ function networkUpdate(cbFunc, cbArg) {
|
|||||||
requestNetInfo(function () {
|
requestNetInfo(function () {
|
||||||
requestBestBlock(function(block, args) {
|
requestBestBlock(function(block, args) {
|
||||||
|
|
||||||
twisterdLastBlockTime = block.time;
|
twisterdLastBlockTime = block.time;
|
||||||
$(".last-block-time").text( timeGmtToText(twisterdLastBlockTime) );
|
$(".last-block-time").text(timeGmtToText(twisterdLastBlockTime));
|
||||||
|
|
||||||
var curTime = new Date().getTime() / 1000;
|
var curTime = new Date().getTime() / 1000;
|
||||||
if (twisterdConnections) {
|
if (twisterdConnections) {
|
||||||
if (twisterdLastBlockTime > curTime + 3600) {
|
if (twisterdLastBlockTime > curTime + 3600) {
|
||||||
$.MAL.setNetworkStatusMsg(polyglot.t("Last block is ahead of your computer time, check your clock."), false);
|
$.MAL.setNetworkStatusMsg(polyglot.t("Last block is ahead of your computer time, check your clock."), false);
|
||||||
twisterdConnectedAndUptodate = false;
|
twisterdConnectedAndUptodate = false;
|
||||||
} else if (twisterdLastBlockTime > curTime - (2 * 3600)) {
|
} else if (twisterdLastBlockTime > curTime - (2 * 3600)) {
|
||||||
if (twisterDhtNodes) {
|
if (twisterDhtNodes) {
|
||||||
$.MAL.setNetworkStatusMsg(polyglot.t("Block chain is up-to-date, twister is ready to use!"), true);
|
$.MAL.setNetworkStatusMsg(polyglot.t("Block chain is up-to-date, twister is ready to use!"), true);
|
||||||
twisterdConnectedAndUptodate = true;
|
twisterdConnectedAndUptodate = true;
|
||||||
} else {
|
|
||||||
$.MAL.setNetworkStatusMsg(polyglot.t("DHT network down."), false);
|
|
||||||
twisterdConnectedAndUptodate = true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
var daysOld = (curTime - twisterdLastBlockTime) / (3600 * 24);
|
$.MAL.setNetworkStatusMsg(polyglot.t("DHT network down."), false);
|
||||||
$.MAL.setNetworkStatusMsg(polyglot.t("downloading_block_chain", {days: daysOld.toFixed(2)}), false);
|
twisterdConnectedAndUptodate = true;
|
||||||
// don't alarm user if blockchain is just a little bit behind
|
|
||||||
twisterdConnectedAndUptodate = (daysOld < 2);
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
var daysOld = (curTime - twisterdLastBlockTime) / (3600 * 24);
|
||||||
|
$.MAL.setNetworkStatusMsg(polyglot.t("downloading_block_chain", {days: daysOld.toFixed(2)}), false);
|
||||||
|
// don't alarm user if blockchain is just a little bit behind
|
||||||
|
twisterdConnectedAndUptodate = (daysOld < 2);
|
||||||
}
|
}
|
||||||
if (args.cbFunc)
|
}
|
||||||
args.cbFunc(args.cbArg);
|
if (args.cbFunc)
|
||||||
|
args.cbFunc(args.cbArg);
|
||||||
}, {cbFunc:cbFunc, cbArg:cbArg} );
|
}, {cbFunc:cbFunc, cbArg:cbArg} );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user