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:
parent
e6b340a8c6
commit
7c79ceede5
2 changed files with 14 additions and 1 deletions
12
lib/api.js
12
lib/api.js
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -715,6 +715,9 @@ if (cluster.isMaster) {
|
|||
bannedIPs = [];
|
||||
}, 60000);
|
||||
async.each(global.config.ports, function (portData) {
|
||||
if (global.config[portData.portType].enable !== true){
|
||||
return;
|
||||
}
|
||||
let handleMessage = function (socket, jsonData, pushMessage) {
|
||||
if (!jsonData.id) {
|
||||
console.warn('Miner RPC request missing RPC id');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue