Update api.js

BugFix: When using multiple coins the miner stats could be incorrect.
This commit is contained in:
hellcatz 2017-03-15 19:41:39 -07:00 committed by GitHub
parent f33fb82820
commit 2d80fc21f6
1 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,6 @@ module.exports = function(logger, portalConfig, poolConfigs){
//console.log(portalStats.statHistory[h].time);
}
}
networkSols = portalStats.statHistory[h].pools[pool].poolStats.networkSols;
// note, h is the last record from above loop, which is latest
for(var pool in portalStats.stats.pools) {
for(var w in portalStats.stats.pools[pool].workers){
@ -70,7 +69,8 @@ module.exports = function(logger, portalConfig, poolConfigs){
}
workers[w].balance = (workers[w].balance || 0);
workers[w].paid = (workers[w].paid || 0);
totalHash += portalStats.statHistory[h].pools[pool].workers[w].hashrate;
totalHash += portalStats.stats.pools[pool].workers[w].hashrate;
networkSols = portalStats.stats.pools[pool].poolStats.networkSols;
}
}
}
@ -116,4 +116,4 @@ module.exports = function(logger, portalConfig, poolConfigs){
}
};
};
};