From ee46e65fcae431da852240fb2a13e7f3f29b30e6 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sat, 26 Oct 2013 02:35:51 +0200 Subject: [PATCH] [FIX] Fixed potential PPLNS issue * getMinimumShareId did not use Share Counts but Weights --- public/include/classes/share.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/include/classes/share.class.php b/public/include/classes/share.class.php index 705c41e1..c8fcc989 100644 --- a/public/include/classes/share.class.php +++ b/public/include/classes/share.class.php @@ -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 < ?