Allow stratum authentication with mining key on non-switching ports

This commit is contained in:
Matt 2014-05-07 01:23:50 -06:00
parent baadebd97d
commit 036f246ab7
1 changed files with 15 additions and 21 deletions

View File

@ -134,10 +134,6 @@ module.exports = function(logger){
if (poolOptions.validateWorkerUsername !== true) if (poolOptions.validateWorkerUsername !== true)
authCallback(true); authCallback(true);
else { else {
port = port.toString();
if (portalConfig.switching) {
for (var switchName in portalConfig.switching) {
if (portalConfig.switching[switchName].enabled && Object.keys(portalConfig.switching[switchName].ports).indexOf(port) !== -1) {
if (workerName.length === 40) { if (workerName.length === 40) {
try { try {
new Buffer(workerName, 'hex'); new Buffer(workerName, 'hex');
@ -147,18 +143,16 @@ module.exports = function(logger){
authCallback(false); authCallback(false);
} }
} }
else else {
authCallback(false);
return;
}
}
}
pool.daemon.cmd('validateaddress', [workerName], function (results) { pool.daemon.cmd('validateaddress', [workerName], function (results) {
var isValid = results.filter(function(r){return r.response.isvalid}).length > 0; var isValid = results.filter(function (r) {
return r.response.isvalid
}).length > 0;
authCallback(isValid); authCallback(isValid);
}); });
} }
}
}; };
handlers.share = function(isValidShare, isValidBlock, data){ handlers.share = function(isValidShare, isValidBlock, data){