Merge pull request #105 from TheSerapher/issue-104

Ignore rejected shares in top list calculations
This commit is contained in:
Sebastian Grewe 2013-06-04 06:59:29 -07:00
commit 3c1eb0cba0

View File

@ -263,6 +263,7 @@ class Statistics {
COUNT(id) AS shares, COUNT(id) AS shares,
SUBSTRING_INDEX( username, '.', 1 ) AS account SUBSTRING_INDEX( username, '.', 1 ) AS account
FROM " . $this->share->getTableName() . " FROM " . $this->share->getTableName() . "
WHERE our_result = 'Y'
GROUP BY account GROUP BY account
ORDER BY shares DESC ORDER BY shares DESC
LIMIT ?"); LIMIT ?");
@ -279,6 +280,7 @@ class Statistics {
SUBSTRING_INDEX( username, '.', 1 ) AS account SUBSTRING_INDEX( username, '.', 1 ) AS account
FROM " . $this->share->getTableName() . " FROM " . $this->share->getTableName() . "
WHERE time > DATE_SUB(now(), INTERVAL 10 MINUTE) WHERE time > DATE_SUB(now(), INTERVAL 10 MINUTE)
AND our_result = 'Y'
GROUP BY account GROUP BY account
ORDER BY hashrate DESC LIMIT ?"); ORDER BY hashrate DESC LIMIT ?");
if ($this->checkStmt($stmt) && $stmt->bind_param("i", $limit) && $stmt->execute() && $result = $stmt->get_result()) if ($this->checkStmt($stmt) && $stmt->bind_param("i", $limit) && $stmt->execute() && $result = $stmt->get_result())