Skip to content

Commit ae337b4

Browse files
authored
Merge pull request #2673 from smiba/patch-1
Fix: Calculate the efficiency correctly in API
2 parents 9e6f02b + a598e6e commit ae337b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: include/pages/api/getpoolstatus.inc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// Efficiency
1414
$aShares = $statistics->getRoundShares();
15-
$aShares['valid'] > 0 ? $dEfficiency = round((100 - (100 / $aShares['valid'] * $aShares['invalid'])), 2) : $dEfficiency = 0;
15+
$aShares['invalid'] > 0 ? $dEfficiency = round((1 - ($aShares['invalid'] / ($aShares['valid'] + $aShares['invalid']))) * 100, 2) : $dEfficiency = 100;
1616

1717
// Fetch RPC data
1818
if ($bitcoin->can_connect() === true){

0 commit comments

Comments
 (0)