@@ -111,7 +111,7 @@ public function getBlocksFound($limit=10) {
111
111
b.*,
112
112
a.username AS finder,
113
113
a.is_anonymous AS is_anonymous,
114
- ROUND(difficulty * POW(2, 32 - " . $ this ->coin ->getTargetBits () . "), 0 ) AS estshares
114
+ ROUND(difficulty * POW(2, 32 - " . $ this ->coin ->getTargetBits () . "), " . $ this -> coin -> getShareDifficultyPrecision () . " ) AS estshares
115
115
FROM " . $ this ->block ->getTableName () . " AS b
116
116
LEFT JOIN " . $ this ->user ->getTableName () . " AS a
117
117
ON b.account_id = a.id
@@ -203,7 +203,7 @@ public function getBlocksSolvedbyWorker($account_id, $limit=25) {
203
203
public function updateShareStatistics ($ aStats , $ iBlockId ) {
204
204
$ this ->debug ->append ("STA " . __METHOD__ , 4 );
205
205
$ stmt = $ this ->mysqli ->prepare ("INSERT INTO $ this ->table (account_id, valid, invalid, block_id) VALUES (?, ?, ?, ?) " );
206
- if ($ this ->checkStmt ($ stmt ) && $ stmt ->bind_param ('iiii ' , $ aStats ['id ' ], $ aStats ['valid ' ], $ aStats ['invalid ' ], $ iBlockId ) && $ stmt ->execute ()) return true ;
206
+ if ($ this ->checkStmt ($ stmt ) && $ stmt ->bind_param ('iddi ' , $ aStats ['id ' ], $ aStats ['valid ' ], $ aStats ['invalid ' ], $ iBlockId ) && $ stmt ->execute ()) return true ;
207
207
return $ this ->sqlError ();
208
208
}
209
209
@@ -213,7 +213,7 @@ public function updateShareStatistics($aStats, $iBlockId) {
213
213
public function insertPPLNSStatistics ($ aStats , $ iBlockId ) {
214
214
$ this ->debug ->append ("STA " . __METHOD__ , 4 );
215
215
$ stmt = $ this ->mysqli ->prepare ("INSERT INTO $ this ->table (account_id, valid, invalid, pplns_valid, pplns_invalid, block_id) VALUES (?, ?, ?, ?, ?, ?) " );
216
- if ($ this ->checkStmt ($ stmt ) && $ stmt ->bind_param ('iiiiii ' , $ aStats ['id ' ], $ aStats ['valid ' ], $ aStats ['invalid ' ], $ aStats ['pplns_valid ' ], $ aStats ['pplns_invalid ' ], $ iBlockId ) && $ stmt ->execute ()) return true ;
216
+ if ($ this ->checkStmt ($ stmt ) && $ stmt ->bind_param ('iddddi ' , $ aStats ['id ' ], $ aStats ['valid ' ], $ aStats ['invalid ' ], $ aStats ['pplns_valid ' ], $ aStats ['pplns_invalid ' ], $ iBlockId ) && $ stmt ->execute ()) return true ;
217
217
return $ this ->sqlError ();
218
218
}
219
219
@@ -261,12 +261,12 @@ public function getCurrentShareRate($interval=180) {
261
261
SELECT
262
262
(
263
263
(
264
- SELECT ROUND(SUM(difficulty) / ?, 2 ) AS sharerate
264
+ SELECT ROUND(SUM(difficulty) / ?, " . $ this -> coin -> getShareDifficultyPrecision () . " ) AS sharerate
265
265
FROM " . $ this ->share ->getTableName () . "
266
266
WHERE time > DATE_SUB(now(), INTERVAL ? SECOND)
267
267
AND our_result = 'Y'
268
268
) + (
269
- SELECT ROUND(SUM(difficulty) / ?, 2 ) AS sharerate
269
+ SELECT ROUND(SUM(difficulty) / ?, " . $ this -> coin -> getShareDifficultyPrecision () . " ) AS sharerate
270
270
FROM " . $ this ->share ->getArchiveTableName () . "
271
271
WHERE time > DATE_SUB(now(), INTERVAL ? SECOND)
272
272
AND our_result = 'Y'
@@ -470,7 +470,7 @@ public function fetchAllUserMiningStats($interval=180) {
470
470
a.username AS account,
471
471
COUNT(DISTINCT t1.username) AS workers,
472
472
IFNULL(SUM(t1.difficulty), 0) AS shares,
473
- ROUND(SUM(t1.difficulty) / ?, 2 ) AS sharerate,
473
+ ROUND(SUM(t1.difficulty) / ?, " . $ this -> coin -> getShareDifficultyPrecision () . " ) AS sharerate,
474
474
IFNULL(AVG(IF(difficulty=0, pow(2, ( " . $ this ->config ['difficulty ' ] . " - 16)), difficulty)), 0) AS avgsharediff
475
475
FROM (
476
476
SELECT
0 commit comments