[FIX] Fixed potential PPLNS issue

* getMinimumShareId did not use Share Counts but Weights
This commit is contained in:
Sebastian Grewe 2013-10-26 02:35:51 +02:00
parent ed6382c81d
commit ee46e65fca

View File

@ -326,7 +326,7 @@ class Share {
$stmt = $this->mysqli->prepare("
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
WHERE our_result = 'Y'
AND id <= ? AND @total < ?