adding gethashps changes to dashboard

This commit is contained in:
Sebastian Grewe 2013-09-14 19:32:37 +02:00
parent 69ed2ab768
commit 727ed1f79a

View File

@ -16,7 +16,21 @@ if ($bitcoin->can_connect() === true) {
}
// Always fetch this since we need for ministats header
$bitcoin->can_connect() === true ? $dNetworkHashrate = $bitcoin->query('getnetworkhashps') : $dNetworkHashrate = 0;
$aRoundShares = $statistics->getRoundShares();
if ($bitcoin->can_connect() === true) {
$dDifficulty = $bitcoin->query('getdifficulty');
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
try { $dNetworkHashrate = $bitcoin->query('getnetworkhashps') / 1000; } catch (Exception $e) {
// Maybe we are SHA
try { $dNetworkHashrate = $bitcoin->query('gethashespersec') / 1000; } catch (Exception $e) {
$dNetworkHashrate = 0;
}
$dNetworkHashrate = 0;
}
} else {
$dNetworkHashrate = 0;
}
// Fetch some data
if (!$iCurrentActiveWorkers = $worker->getCountAllActiveWorkers()) $iCurrentActiveWorkers = 0;