From eb9a07ef0b2a2d630540c38f1dad91ef8951d31a Mon Sep 17 00:00:00 2001 From: Sammy Libre Date: Thu, 17 Dec 2015 22:27:10 +0500 Subject: [PATCH] Display the approximate time of next epoch --- www/index.html | 1 + www/script.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/www/index.html b/www/index.html index cf106a1..9d43e16 100644 --- a/www/index.html +++ b/www/index.html @@ -50,6 +50,7 @@ {{#if diff}} Difficulty: {{formatNumber diff}} {{/if}} + Next Epoch: {{formatRelative nextEpoch now units="hour"}} Mode: {{#if current.pool}} POOL diff --git a/www/script.js b/www/script.js index 468ceba..0038d50 100644 --- a/www/script.js +++ b/www/script.js @@ -20,6 +20,9 @@ function refreshStats(template) { stats.miners = stats.miners.sort(compare) } + var epochOffset = (30000 - (stats.height % 30000)) * 1000 * 17 + stats.nextEpoch = stats.now + epochOffset + // Repaint stats var html = template(stats); $('#stats').html(html);