properly display average time to find next block

This commit is contained in:
Sebastian Grewe 2013-05-14 20:54:01 +02:00
parent 0e7f7d75f2
commit da6bcb1c48

View File

@ -67,7 +67,10 @@ if (!$iCurrentPoolHashrate = $memcache->get('iCurrentPoolHashrate')) {
$iCurrentPoolHashrate = $statistics->getCurrentHashrate();
$memcache->set('iCurrentPoolHashrate', $iCurrentPoolHashrate, 60);
}
$iEstTime = ((($dDifficulty * pow(2,32)) / $iCurrentPoolHashrate) / 3600);
// Time in seconds, not hours, using modifier in smarty to translate
$iEstTime = $dDifficulty * pow(2,32) / ($iCurrentPoolHashrate * 1000);
// Time since last block
$now = new DateTime( "now" );
if (!empty($aBlockData)) {
$dTimeSinceLast = ($now->getTimestamp() - $aBlockData['time']);