[FIX] Calculations

This commit is contained in:
Sebastian Grewe 2014-05-15 10:46:10 +02:00
parent d294e266a4
commit 4cb0e1c3df
2 changed files with 4 additions and 7 deletions

View File

@ -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));
}

View File

@ -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) + "%");