mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-12-01 11:43:58 +01:00
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:
+11
-1
@@ -62,7 +62,17 @@ app.get('/pool/stats', function (req, res) {
|
|||||||
let localCache = global.database.getCache('pool_stats_global');
|
let localCache = global.database.getCache('pool_stats_global');
|
||||||
delete(localCache.minerHistory);
|
delete(localCache.minerHistory);
|
||||||
delete(localCache.hashHistory);
|
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) {
|
app.get('/pool/chart/hashrate', function (req, res) {
|
||||||
|
|||||||
@@ -715,6 +715,9 @@ if (cluster.isMaster) {
|
|||||||
bannedIPs = [];
|
bannedIPs = [];
|
||||||
}, 60000);
|
}, 60000);
|
||||||
async.each(global.config.ports, function (portData) {
|
async.each(global.config.ports, function (portData) {
|
||||||
|
if (global.config[portData.portType].enable !== true){
|
||||||
|
return;
|
||||||
|
}
|
||||||
let handleMessage = function (socket, jsonData, pushMessage) {
|
let handleMessage = function (socket, jsonData, pushMessage) {
|
||||||
if (!jsonData.id) {
|
if (!jsonData.id) {
|
||||||
console.warn('Miner RPC request missing RPC id');
|
console.warn('Miner RPC request missing RPC id');
|
||||||
|
|||||||
Reference in New Issue
Block a user