diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index 257d33d4..5c4bde10 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -7,15 +7,16 @@ if (!defined('SECURITY')) // Globally available variables $debug->append('Global smarty variables', 3); +// Defaults to get rid of PHP Notice warnings +$dDifficulty = 1; + // Only run these if the user is logged in if ($_SESSION['AUTHENTICATED']) { $aRoundShares = $statistics->getRoundShares(); - if ($bitcoin->can_connect() === true){ + if ($bitcoin->can_connect() === true) $dDifficulty = $bitcoin->query('getdifficulty'); - } else { - $dDifficulty = 1; - } } + // Fetch some data $iCurrentActiveWorkers = $worker->getCountAllActiveWorkers(); $iCurrentPoolHashrate = $statistics->getCurrentHashrate();