Fixing round estimates on public stats page

* Fix: Display round restimates when making pool stats public via ACL
* Fix: Display proper pool efficiency when pool stats are public

Fixes #585
This commit is contained in:
Sebastian Grewe 2013-08-13 09:20:06 +02:00
parent 581888fe1f
commit 22e7904da7

View File

@ -12,14 +12,13 @@ $dDifficulty = 1;
$aRoundShares = 1; $aRoundShares = 1;
// Only run these if the user is logged in // Only run these if the user is logged in
if (@$_SESSION['AUTHENTICATED']) { $aRoundShares = $statistics->getRoundShares();
$aRoundShares = $statistics->getRoundShares(); if ($bitcoin->can_connect() === true) {
if ($bitcoin->can_connect() === true) { $dDifficulty = $bitcoin->query('getdifficulty');
$dDifficulty = $bitcoin->query('getdifficulty'); if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty)) $dDifficulty = $dDifficulty['proof-of-work'];
$dDifficulty = $dDifficulty['proof-of-work'];
}
} }
// Always fetch this since we need for ministats header // Always fetch this since we need for ministats header
$bitcoin->can_connect() === true ? $dNetworkHashrate = $bitcoin->query('getnetworkhashps') : $dNetworkHashrate = 0; $bitcoin->can_connect() === true ? $dNetworkHashrate = $bitcoin->query('getnetworkhashps') : $dNetworkHashrate = 0;