From 4cb0e1c3df6f6337575961cc0dfabbdf608ddd78 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Thu, 15 May 2014 10:46:10 +0200 Subject: [PATCH] [FIX] Calculations --- include/classes/statistics.class.php | 7 ++----- templates/bootstrap/dashboard/js/api.tpl | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/classes/statistics.class.php b/include/classes/statistics.class.php index 60de0c09..26edd4c9 100644 --- a/include/classes/statistics.class.php +++ b/include/classes/statistics.class.php @@ -827,13 +827,10 @@ class Statistics extends Base { } $dDifficulty = $this->bitcoin->getdifficulty(); } else { - $dNetworkHashrate = 1; + $hashrate = 1; $dDifficulty = 1; } - if($hashrate <= 0){ - return $this->memcache->setCache(__FUNCTION__, $this->config['cointarget']); - } - + if ($hashrate <= 0) $hashrate = 1; return $this->memcache->setCache(__FUNCTION__, $this->coin->calcNetworkExpectedTimePerBlock($dDifficulty, $hashrate)); } diff --git a/templates/bootstrap/dashboard/js/api.tpl b/templates/bootstrap/dashboard/js/api.tpl index 388221a6..98182ba8 100644 --- a/templates/bootstrap/dashboard/js/api.tpl +++ b/templates/bootstrap/dashboard/js/api.tpl @@ -117,8 +117,8 @@ $(document).ready(function(){ $('#b-nextdiff').html('n/a'); $('#b-nextdiffc').html(' No Estimates'); } - var minutes = Math.floor(data.getdashboarddata.data.network.esttimeperblock / 60); - var seconds = Math.floor(data.getdashboarddata.data.network.esttimeperblock - minutes * 60); + var minutes = Math.floor(data.getdashboarddata.data.pool.esttimeperblock / 60); + var seconds = Math.floor(data.getdashboarddata.data.pool.esttimeperblock - minutes * 60); $('#b-esttimeperblock').html(minutes + " minutes " + seconds + " seconds"); // <- this needs some nicer format $('#b-nblock').html(data.getdashboarddata.data.network.block); $('#b-roundprogress').html(number_format(parseFloat(data.getdashboarddata.data.pool.shares.progress).toFixed(2), 2) + "%");