diff --git a/public/include/pages/dashboard.inc.php b/public/include/pages/dashboard.inc.php index 22a4edec..e66558a4 100644 --- a/public/include/pages/dashboard.inc.php +++ b/public/include/pages/dashboard.inc.php @@ -6,32 +6,15 @@ if (!defined('SECURITY')) die('Hacking attempt'); if ($user->isAuthenticated()) { if (! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300; // Defaults to get rid of PHP Notice warnings + $dNetworkHashrate = 0; $dDifficulty = 1; $aRoundShares = 1; // Only run these if the user is logged in $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']; - } - - // Always fetch this since we need for ministats header - $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; + $dDifficulty = $bitcoin->getdifficulty(); + $dNetworkHashrate = $bitcoin->getnetworkhashps(); } // Fetch some data