Skip to content

Commit db35ee6

Browse files
committed
Update to fix bug with workers vanishing.
1 parent 67026fe commit db35ee6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

proxy.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -592,14 +592,18 @@ function enumerateWorkerStats(){
592592
if (activeWorkers[poolID].hasOwnProperty(workerID)) {
593593
let workerData = activeWorkers[poolID][workerID];
594594
if (typeof workerData !== 'undefined') {
595-
if (workerData.lastContact < ((Math.floor((Date.now())/1000) - 120))){
595+
try{
596+
if (workerData.lastContact < ((Math.floor((Date.now())/1000) - 120))){
597+
delete activeWorkers[poolID][workerID];
598+
continue;
599+
}
600+
stats.miners += 1;
601+
stats.hashes += workerData.hashes;
602+
stats.hashRate += workerData.avgSpeed;
603+
stats.diff += workerData.diff;
604+
} catch (err) {
596605
delete activeWorkers[poolID][workerID];
597-
continue;
598606
}
599-
stats.miners += 1;
600-
stats.hashes += workerData.hashes;
601-
stats.hashRate += workerData.avgSpeed;
602-
stats.diff += workerData.diff;
603607
} else {
604608
delete activeWorkers[poolID][workerID];
605609
}

0 commit comments

Comments
 (0)