[FIX] Fixed potential PPLNS issue
* getMinimumShareId did not use Share Counts but Weights
This commit is contained in:
parent
ed6382c81d
commit
ee46e65fca
@ -326,7 +326,7 @@ class Share {
|
|||||||
$stmt = $this->mysqli->prepare("
|
$stmt = $this->mysqli->prepare("
|
||||||
SELECT MIN(b.id) AS id FROM
|
SELECT MIN(b.id) AS id FROM
|
||||||
(
|
(
|
||||||
SELECT id, @total := @total + IF(difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty) AS total
|
SELECT id, @total := @total + IF(difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty) / POW(2, (" . $this->config['difficulty'] . " - 16)) AS total
|
||||||
FROM $this->table, (SELECT @total := 0) AS a
|
FROM $this->table, (SELECT @total := 0) AS a
|
||||||
WHERE our_result = 'Y'
|
WHERE our_result = 'Y'
|
||||||
AND id <= ? AND @total < ?
|
AND id <= ? AND @total < ?
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user