|
|
@ -93,7 +93,6 @@ var buildPoolConfigs = function(){ |
|
|
|
|
|
|
|
var poolConfigFiles = []; |
|
|
|
|
|
|
|
|
|
|
|
/* Get filenames of pool config json files that are enabled */ |
|
|
|
fs.readdirSync(configDir).forEach(function(file){ |
|
|
|
if (!fs.existsSync(configDir + file) || path.extname(configDir + file) !== '.json') return; |
|
|
@ -103,7 +102,6 @@ var buildPoolConfigs = function(){ |
|
|
|
poolConfigFiles.push(poolOptions); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
/* Ensure no pool uses any of the same ports as another pool */ |
|
|
|
for (var i = 0; i < poolConfigFiles.length; i++){ |
|
|
|
var ports = Object.keys(poolConfigFiles[i].ports); |
|
|
@ -127,7 +125,6 @@ var buildPoolConfigs = function(){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
poolConfigFiles.forEach(function(poolOptions){ |
|
|
|
|
|
|
|
poolOptions.coinFileName = poolOptions.coin; |
|
|
@ -165,7 +162,6 @@ var buildPoolConfigs = function(){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
configs[poolOptions.coin.name] = poolOptions; |
|
|
|
|
|
|
|
if (!(coinProfile.algorithm in algos)){ |
|
|
@ -215,7 +211,6 @@ var spawnPoolWorkers = function(){ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var serializedConfigs = JSON.stringify(poolConfigs); |
|
|
|
|
|
|
|
var numForks = (function(){ |
|
|
@ -326,7 +321,6 @@ var spawnPoolWorkers = function(){ |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var startCliListener = function(){ |
|
|
|
|
|
|
|
var cliPort = portalConfig.cliPort; |
|
|
@ -359,7 +353,6 @@ var startCliListener = function(){ |
|
|
|
}).start(); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var processCoinSwitchCommand = function(params, options, reply){ |
|
|
|
|
|
|
|
var logSystem = 'CLI'; |
|
|
@ -400,13 +393,11 @@ var processCoinSwitchCommand = function(params, options, reply){ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var switchNames = []; |
|
|
|
|
|
|
|
if (params[1]) { |
|
|
|
switchNames.push(params[1]); |
|
|
|
} |
|
|
|
else{ |
|
|
|
} else { |
|
|
|
for (var name in portalConfig.switching){ |
|
|
|
if (portalConfig.switching[name].enabled && portalConfig.switching[name].algorithm === options.algorithm) |
|
|
|
switchNames.push(name); |
|
|
@ -427,11 +418,8 @@ var processCoinSwitchCommand = function(params, options, reply){ |
|
|
|
}); |
|
|
|
|
|
|
|
reply('Switch message sent to pool workers'); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var startPaymentProcessor = function(){ |
|
|
|
|
|
|
|
var enabledForAny = false; |
|
|
@ -477,7 +465,6 @@ var startWebsite = function(){ |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var startProfitSwitch = function(){ |
|
|
|
|
|
|
|
if (!portalConfig.profitSwitch || !portalConfig.profitSwitch.enabled){ |
|
|
@ -498,8 +485,6 @@ var startProfitSwitch = function(){ |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(function init(){ |
|
|
|
|
|
|
|
poolConfigs = buildPoolConfigs(); |
|
|
|