@@ -111,7 +111,7 @@ public function getBlocksFound($limit=10) {
111111 b.*,
112112 a.username AS finder,
113113 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
115115 FROM " . $ this ->block ->getTableName () . " AS b
116116 LEFT JOIN " . $ this ->user ->getTableName () . " AS a
117117 ON b.account_id = a.id
@@ -203,7 +203,7 @@ public function getBlocksSolvedbyWorker($account_id, $limit=25) {
203203 public function updateShareStatistics ($ aStats , $ iBlockId ) {
204204 $ this ->debug ->append ("STA " . __METHOD__ , 4 );
205205 $ 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 ;
207207 return $ this ->sqlError ();
208208 }
209209
@@ -213,7 +213,7 @@ public function updateShareStatistics($aStats, $iBlockId) {
213213 public function insertPPLNSStatistics ($ aStats , $ iBlockId ) {
214214 $ this ->debug ->append ("STA " . __METHOD__ , 4 );
215215 $ 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 ;
217217 return $ this ->sqlError ();
218218 }
219219
@@ -261,12 +261,12 @@ public function getCurrentShareRate($interval=180) {
261261 SELECT
262262 (
263263 (
264- SELECT ROUND(SUM(difficulty) / ?, 2 ) AS sharerate
264+ SELECT ROUND(SUM(difficulty) / ?, " . $ this -> coin -> getShareDifficultyPrecision () . " ) AS sharerate
265265 FROM " . $ this ->share ->getTableName () . "
266266 WHERE time > DATE_SUB(now(), INTERVAL ? SECOND)
267267 AND our_result = 'Y'
268268 ) + (
269- SELECT ROUND(SUM(difficulty) / ?, 2 ) AS sharerate
269+ SELECT ROUND(SUM(difficulty) / ?, " . $ this -> coin -> getShareDifficultyPrecision () . " ) AS sharerate
270270 FROM " . $ this ->share ->getArchiveTableName () . "
271271 WHERE time > DATE_SUB(now(), INTERVAL ? SECOND)
272272 AND our_result = 'Y'
@@ -470,7 +470,7 @@ public function fetchAllUserMiningStats($interval=180) {
470470 a.username AS account,
471471 COUNT(DISTINCT t1.username) AS workers,
472472 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,
474474 IFNULL(AVG(IF(difficulty=0, pow(2, ( " . $ this ->config ['difficulty ' ] . " - 16)), difficulty)), 0) AS avgsharediff
475475 FROM (
476476 SELECT
0 commit comments