mirror of https://github.com/BTCPrivate/z-nomp.git
if invalid adress + workername = 40
if invalid adress + workername = 40 chars, it doesnt get authenticated..
This commit is contained in:
parent
e8e52e3eb3
commit
2c68351b4e
|
@ -135,16 +135,6 @@ module.exports = function(logger){
|
||||||
handlers.auth = function(port, workerName, password, authCallback){
|
handlers.auth = function(port, workerName, password, authCallback){
|
||||||
if (poolOptions.validateWorkerUsername !== true)
|
if (poolOptions.validateWorkerUsername !== true)
|
||||||
authCallback(true);
|
authCallback(true);
|
||||||
else {
|
|
||||||
if (workerName.length === 40) {
|
|
||||||
try {
|
|
||||||
new Buffer(workerName, 'hex');
|
|
||||||
authCallback(true);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
authCallback(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
pool.daemon.cmd('validateaddress', [String(workerName).split(".")[0]], function (results) {
|
pool.daemon.cmd('validateaddress', [String(workerName).split(".")[0]], function (results) {
|
||||||
var isValid = results.filter(function (r) {
|
var isValid = results.filter(function (r) {
|
||||||
|
@ -154,7 +144,6 @@ module.exports = function(logger){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
handlers.share = function(isValidShare, isValidBlock, data){
|
handlers.share = function(isValidShare, isValidBlock, data){
|
||||||
|
|
Loading…
Reference in New Issue