Fixing PPLNS target calculation on blockavg
This will fix #492 with PPLNS targets not taking the blocks in proper order.
This commit is contained in:
parent
5f161cdbb0
commit
440ca027a2
@ -109,7 +109,7 @@ class Block {
|
|||||||
* @return data float Float value of average shares
|
* @return data float Float value of average shares
|
||||||
**/
|
**/
|
||||||
public function getAvgBlockShares($limit=10) {
|
public function getAvgBlockShares($limit=10) {
|
||||||
$stmt = $this->mysqli->prepare("SELECT AVG(shares) AS average FROM $this->table LIMIT ?");
|
$stmt = $this->mysqli->prepare("SELECT AVG(shares) AS average FROM $this->table ORDER BY height DESC LIMIT ?");
|
||||||
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $limit) && $stmt->execute() && $result = $stmt->get_result())
|
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $limit) && $stmt->execute() && $result = $stmt->get_result())
|
||||||
return (float)$result->fetch_object()->average;
|
return (float)$result->fetch_object()->average;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user