[UPDATE] Do not use DateTime class, use time()

This commit is contained in:
Sebastian Grewe 2013-11-13 12:49:30 +01:00
parent 010a9f6f00
commit 629cc22e8d

View File

@ -34,9 +34,8 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$iCurrentPoolHashrate > 0 ? $iEstTime = $dDifficulty * pow(2,32) / ($iCurrentPoolHashrate * 1000) : $iEstTime = 0; $iCurrentPoolHashrate > 0 ? $iEstTime = $dDifficulty * pow(2,32) / ($iCurrentPoolHashrate * 1000) : $iEstTime = 0;
// Time since last block // Time since last block
$now = new DateTime( "now" );
if (!empty($aBlockData)) { if (!empty($aBlockData)) {
$dTimeSinceLast = ($now->getTimestamp() - $aBlockData['time']); $dTimeSinceLast = (time() - $aBlockData['time']);
if ($dTimeSinceLast < 0) $dTimeSinceLast = 0; if ($dTimeSinceLast < 0) $dTimeSinceLast = 0;
} else { } else {
$dTimeSinceLast = 0; $dTimeSinceLast = 0;
@ -45,7 +44,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
// Past blocks found, max 4 weeks back // Past blocks found, max 4 weeks back
$iFoundBlocksByTime = $statistics->getLastBlocksbyTime(); $iFoundBlocksByTime = $statistics->getLastBlocksbyTime();
$iFirstBlockFound = $statistics->getFirstBlockFound(); $iFirstBlockFound = $statistics->getFirstBlockFound();
$iTimeSinceFirstBlockFound = ($now->getTimestamp() - $iFirstBlockFound); $iTimeSinceFirstBlockFound = (time() - $iFirstBlockFound);
// Propagate content our template // Propagate content our template
$smarty->assign("FIRSTBLOCKFOUND", $iTimeSinceFirstBlockFound); $smarty->assign("FIRSTBLOCKFOUND", $iTimeSinceFirstBlockFound);