[FIX] Honor target_bits for hashrate

This commit is contained in:
Sebastian Grewe 2014-01-19 17:17:24 +01:00
parent cf49db4535
commit 0fb543c3ed

View File

@ -458,7 +458,7 @@ class Statistics extends Base {
SELECT SELECT
a.id AS id, a.id AS id,
a.username AS account, a.username AS account,
IFNULL(ROUND(SUM(t1.difficulty) * POW(2, 16) / ? / 1000, 2), 0) AS hashrate, IFNULL(ROUND(SUM(t1.difficulty) * POW(2, " . $this->config['target_bits'] . ") / ? / 1000, 2), 0) AS hashrate,
ROUND(COUNT(t1.id) / ?, 2) AS sharerate, ROUND(COUNT(t1.id) / ?, 2) AS sharerate,
IFNULL(AVG(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)), 0) AS avgsharediff IFNULL(AVG(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)), 0) AS avgsharediff
FROM ( FROM (
@ -490,7 +490,6 @@ class Statistics extends Base {
var_dump($aData); var_dump($aData);
return $this->memcache->setCache(STATISTICS_ALL_USER_HASHRATES, $aData); return $this->memcache->setCache(STATISTICS_ALL_USER_HASHRATES, $aData);
} else { } else {
echo $this->mysqli->error;
return $this->sqlError(); return $this->sqlError();
} }
} }