Skip to content

Commit feb9586

Browse files
committed
[CHANGE] Shares/s to diff1 shares/s
1 parent 2c773fc commit feb9586

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/classes/statistics.class.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,12 @@ public function getCurrentShareRate($interval=180) {
261261
SELECT
262262
(
263263
(
264-
SELECT ROUND(COUNT(id) / ?, 2) AS sharerate
264+
SELECT ROUND(SUM(difficulty) / ?, 2) AS sharerate
265265
FROM " . $this->share->getTableName() . "
266266
WHERE time > DATE_SUB(now(), INTERVAL ? SECOND)
267267
AND our_result = 'Y'
268268
) + (
269-
SELECT ROUND(COUNT(id) / ?, 2) AS sharerate
269+
SELECT ROUND(SUM(difficulty) / ?, 2) AS sharerate
270270
FROM " . $this->share->getArchiveTableName() . "
271271
WHERE time > DATE_SUB(now(), INTERVAL ? SECOND)
272272
AND our_result = 'Y'
@@ -470,7 +470,7 @@ public function fetchAllUserMiningStats($interval=180) {
470470
a.username AS account,
471471
COUNT(DISTINCT t1.username) AS workers,
472472
IFNULL(SUM(t1.difficulty), 0) AS shares,
473-
ROUND(COUNT(t1.id) / ?, 2) AS sharerate,
473+
ROUND(SUM(t1.difficulty) / ?, 2) AS sharerate,
474474
IFNULL(AVG(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)), 0) AS avgsharediff
475475
FROM (
476476
SELECT
@@ -558,7 +558,7 @@ public function getUserUnpaidPPSShares($username, $account_id=NULL, $last_paid_p
558558
* Get Shares per x interval by user
559559
* @param username string username
560560
* @param $account_id int account id
561-
* @return data integer Current Sharerate in shares/s
561+
* @return data integer Current Sharerate in diff1 shares/s
562562
**/
563563
public function getUserMiningStats($username, $account_id=NULL, $interval=180) {
564564
$this->debug->append("STA " . __METHOD__, 4);
@@ -575,7 +575,7 @@ public function getUserMiningStats($username, $account_id=NULL, $interval=180) {
575575
if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
576576
$stmt = $this->mysqli->prepare("
577577
SELECT
578-
IFNULL(COUNT(*) / ?, 0) AS sharerate,
578+
IFNULL(SUM(difficulty) / ?, 0) AS sharerate,
579579
IFNULL(SUM(difficulty), 0) AS shares,
580580
IFNULL(AVG(difficulty), 0) AS avgsharediff
581581
FROM (

0 commit comments

Comments
 (0)