mirror of https://github.com/BTCPrivate/z-nomp.git
Allow stratum authentication with mining key on non-switching ports
This commit is contained in:
parent
baadebd97d
commit
036f246ab7
|
@ -134,30 +134,24 @@ module.exports = function(logger){
|
||||||
if (poolOptions.validateWorkerUsername !== true)
|
if (poolOptions.validateWorkerUsername !== true)
|
||||||
authCallback(true);
|
authCallback(true);
|
||||||
else {
|
else {
|
||||||
port = port.toString();
|
if (workerName.length === 40) {
|
||||||
if (portalConfig.switching) {
|
try {
|
||||||
for (var switchName in portalConfig.switching) {
|
new Buffer(workerName, 'hex');
|
||||||
if (portalConfig.switching[switchName].enabled && Object.keys(portalConfig.switching[switchName].ports).indexOf(port) !== -1) {
|
authCallback(true);
|
||||||
if (workerName.length === 40) {
|
}
|
||||||
try {
|
catch (e) {
|
||||||
new Buffer(workerName, 'hex');
|
authCallback(false);
|
||||||
authCallback(true);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
authCallback(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
authCallback(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
pool.daemon.cmd('validateaddress', [workerName], function (results) {
|
||||||
|
var isValid = results.filter(function (r) {
|
||||||
|
return r.response.isvalid
|
||||||
|
}).length > 0;
|
||||||
|
authCallback(isValid);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
pool.daemon.cmd('validateaddress', [workerName], function(results){
|
|
||||||
var isValid = results.filter(function(r){return r.response.isvalid}).length > 0;
|
|
||||||
authCallback(isValid);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue