Ensure configuration value for validation of pool workers is honored

This commit is contained in:
Jerry Brady 2014-04-05 23:40:50 +00:00
parent 575158f858
commit 634cfb7bff
1 changed files with 9 additions and 5 deletions

View File

@ -87,10 +87,14 @@ module.exports = function(logger){
var shareProcessor = new ShareProcessor(logger, poolOptions)
handlers.auth = function(workerName, password, authCallback){
pool.daemon.cmd('validateaddress', [workerName], function(results){
var isValid = results.filter(function(r){return r.response.isvalid}).length > 0;
authCallback(isValid);
});
if (shareProcessing.internal.validateWorkerAddress !== true)
authCallback(true);
else {
pool.daemon.cmd('validateaddress', [workerName], function(results){
var isValid = results.filter(function(r){return r.response.isvalid}).length > 0;
authCallback(isValid);
});
}
};
handlers.share = function(isValidShare, isValidBlock, data){
@ -171,4 +175,4 @@ module.exports = function(logger){
}
};
};