Setting up port disable/lockout from the SQL into the main code base for the pool. Also making it so the API won't list a non-used pool type.

This commit is contained in:
Alexander Blair
2017-02-15 16:22:35 -08:00
parent e6b340a8c6
commit 7c79ceede5
2 changed files with 14 additions and 1 deletions
+11 -1
View File
@@ -62,7 +62,17 @@ app.get('/pool/stats', function (req, res) {
let localCache = global.database.getCache('pool_stats_global');
delete(localCache.minerHistory);
delete(localCache.hashHistory);
res.json({pool_list: ['pplns', 'pps', 'solo'], pool_statistics: localCache});
let pool_list = [];
if(global.config.pps.enable === true){
pool_list.push('pps');
}
if(global.config.solo.enable === true){
pool_list.push('solo');
}
if(global.config.pplns.enable === true){
pool_list.push('pplns');
}
res.json({pool_list: pool_list, pool_statistics: localCache});
});
app.get('/pool/chart/hashrate', function (req, res) {