From 36cda9b629cd5f89b8e79a7862a655d4fd15e201 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Tue, 14 May 2013 00:08:12 +0200 Subject: [PATCH] removed debug output, added time to find next block --- public/include/pages/statistics/pool.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/include/pages/statistics/pool.inc.php b/public/include/pages/statistics/pool.inc.php index c9990618..c737853c 100644 --- a/public/include/pages/statistics/pool.inc.php +++ b/public/include/pages/statistics/pool.inc.php @@ -30,7 +30,6 @@ if (!$aHashData = $memcache->get('aHashData')) { WHERE time > DATE_SUB(now(), INTERVAL 10 MINUTE) GROUP BY account ORDER BY hashrate DESC LIMIT 15"); -echo $mysqli->error; $stmt->execute(); $hashrates= $stmt->get_result(); $aHashData = $hashrates->fetch_all(MYSQLI_ASSOC); @@ -38,7 +37,6 @@ echo $mysqli->error; $memcache->set('aHashData', $aHashData, 60); } - if (! $aContributerData = $memcache->get('aContributerData') ) { // Top 15 Contributers $stmt = $mysqli->prepare("SELECT count(id) AS shares, SUBSTRING_INDEX( `username` , '.', 1 ) AS account FROM shares GROUP BY account ORDER BY shares DESC LIMIT 15"); @@ -64,7 +62,12 @@ $aBlocksFoundData = $blocksfound->fetch_all(MYSQLI_ASSOC); $stmt->close(); // Estimated time to find the next block -$iEstTime = (($dDifficulty * bcpow(2,$config['difficulty'])) / ( $settings->getValue('currenthashrate') * 1000)); +if (!$iCurrentPoolHashrate = $memcache->get('iCurrentPoolHashrate')) { + $debug->append('Fetching iCurrentPoolHashrate from database'); + $iCurrentPoolHashrate = $statistics->getCurrentHashrate(); + $memcache->set('iCurrentPoolHashrate', $iCurrentPoolHashrate, 60); +} +$iEstTime = (($dDifficulty * bcpow(2,$config['difficulty'])) / $iCurrentPoolHashrate); $now = new DateTime( "now" ); if (!empty($aBlockData)) { $dTimeSinceLast = ($now->getTimestamp() - $aBlockData['time']);