From ca0634929e73cfd3106477edb3d98592dfca8b37 Mon Sep 17 00:00:00 2001 From: Neozonz Date: Mon, 20 Jan 2014 14:32:19 -0800 Subject: [PATCH] [FIX] Whoopsie --- public/include/classes/statistics.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/include/classes/statistics.class.php b/public/include/classes/statistics.class.php index 14d79435..5ef40ea9 100644 --- a/public/include/classes/statistics.class.php +++ b/public/include/classes/statistics.class.php @@ -622,15 +622,15 @@ class Statistics extends Base { **/ public function getWorkerHashrate($worker_id, $interval=180) { $this->debug->append("STA " . __METHOD__, 4); - if ($data = $this->memcache->get(__FUNCTION__ . $username)) return $data; + if ($data = $this->memcache->get(__FUNCTION__ . $worker_id)) return $data; $stmt = $this->mysqli->prepare(" SELECT IFNULL(ROUND(SUM(IF(difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * POW(2, " . $this->config['target_bits'] . ") / 600 / 1000), 0) AS hashrate FROM " . $this->share->getTableName() . " AS WHERE username = '?' AND our_result = 'Y' AND time > DATE_SUB(now(), INTERVAL ? SECOND)); - if ($this->checkStmt($stmt) && $stmt->bind_param("i", $username, $interval) && $stmt->execute() && $result = $stmt->get_result() ) - return $this->memcache->setCache(__FUNCTION__ . $username, $result->fetch_object()->hashrate); + if ($this->checkStmt($stmt) && $stmt->bind_param("i", $worker_id, $interval) && $stmt->execute() && $result = $stmt->get_result() ) + return $this->memcache->setCache(__FUNCTION__ . $worker_id, $result->fetch_object()->hashrate); return $this->sqlError(); }