From d4db477c2dcfc03b2c0d77167e58f5229318a645 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sun, 19 Jan 2014 17:22:00 +0100 Subject: [PATCH] [FIX] Also honor diff for share difficulties if unset --- public/include/classes/statistics.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/include/classes/statistics.class.php b/public/include/classes/statistics.class.php index b5fce2bb..2e759959 100644 --- a/public/include/classes/statistics.class.php +++ b/public/include/classes/statistics.class.php @@ -464,14 +464,14 @@ class Statistics extends Base { FROM ( SELECT id, - IFNULL(IF(difficulty=0, pow(2, (20 - 16)), difficulty), 0) AS difficulty, + IF(s.difficulty = 0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty) AS difficulty username FROM shares WHERE time > DATE_SUB(now(), INTERVAL ? SECOND) AND our_result = 'Y' UNION SELECT share_id, - IFNULL(IF(difficulty=0, pow(2, (20 - 16)), difficulty), 0) AS difficulty, + IF(s.difficulty = 0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty) AS difficulty username FROM shares_archive WHERE time > DATE_SUB(now(), INTERVAL ? SECOND) AND our_result = 'Y'