properly calcluate estimated time with 50/50 chance to find blocks, also properly calculate LTC per day matching litecoinpool.org/calc

This commit is contained in:
Sebastian Grewe 2013-05-14 11:00:39 +02:00
parent 924646619d
commit f16de4f81f
2 changed files with 2 additions and 3 deletions

View File

@ -67,7 +67,7 @@ if (!$iCurrentPoolHashrate = $memcache->get('iCurrentPoolHashrate')) {
$iCurrentPoolHashrate = $statistics->getCurrentHashrate();
$memcache->set('iCurrentPoolHashrate', $iCurrentPoolHashrate, 60);
}
$iEstTime = (($dDifficulty * bcpow(2,$config['difficulty'])) / $iCurrentPoolHashrate);
$iEstTime = ((($dDifficulty * pow(2,32)) / $iCurrentPoolHashrate) / 3600);
$now = new DateTime( "now" );
if (!empty($aBlockData)) {
$dTimeSinceLast = ($now->getTimestamp() - $aBlockData['time']);
@ -84,7 +84,6 @@ $smarty->assign("TOPHASHRATES", $aHashData);
$smarty->assign("CURRENTBLOCK", $iBlock);
$smarty->assign("LASTBLOCK", $aBlockData['height']);
$smarty->assign("DIFFICULTY", $dDifficulty);
$smarty->assign("TARGETDIFF", $config['difficulty']);
$smarty->assign("REWARD", $config['reward']);
if ($_SESSION['AUTHENTICATED']) {

View File

@ -17,7 +17,7 @@
<td>{$rank++}</td>
<td>{$TOPHASHRATES[hashrate].account}</td>
<td>{$TOPHASHRATES[hashrate].hashrate|number_format}</td>
<td>{math equation="round(( 24 / (((diff * pow(2,targetdiff)) / hashrate) / 3600) * reward ),3)" diff=$DIFFICULTY targetdiff=$TARGETDIFF hashrate=$TOPHASHRATES[hashrate].hashrate reward=$REWARD}</td>
<td>{math equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24),3)" diff=$DIFFICULTY reward=$REWARD hashrate=$TOPHASHRATES[hashrate].hashrate}</td>
</tr>
{/section}
</tbody>