if invalid adress + workername = 40

if invalid adress + workername = 40 chars, it doesnt get authenticated..
This commit is contained in:
sennevb 2017-08-15 09:34:44 +02:00 committed by GitHub
parent e8e52e3eb3
commit 2c68351b4e
1 changed files with 1 additions and 12 deletions

View File

@ -136,16 +136,6 @@ module.exports = function(logger){
if (poolOptions.validateWorkerUsername !== true)
authCallback(true);
else {
if (workerName.length === 40) {
try {
new Buffer(workerName, 'hex');
authCallback(true);
}
catch (e) {
authCallback(false);
}
}
else {
pool.daemon.cmd('validateaddress', [String(workerName).split(".")[0]], function (results) {
var isValid = results.filter(function (r) {
return r.response.isvalid
@ -153,8 +143,7 @@ module.exports = function(logger){
authCallback(isValid);
});
}
}
};
handlers.share = function(isValidShare, isValidBlock, data){