Added initial vardiff. Needs testing...

This commit is contained in:
Matthew Little 2014-01-15 21:54:41 -07:00
parent 94a0b04323
commit e1c24559f0
2 changed files with 5 additions and 2 deletions

View File

@ -41,11 +41,14 @@ var pool = module.exports = function pool(options, authorizeFn){
function SetupVarDiff(){
_this.varDiff = new varDifff(options.varDiff, options.difficulty);
_this.varDiff = new varDiff(options.varDiff, options.difficulty);
_this.varDiff.on('difficultyRequest', function(){
emitLog('varDiff', 'Difficulty requested for vardiff');
if (_this.stratumServer)
RequestDifficulty(function(){});
}).on('newDifficulty', function(client, newDiff){
client.sendDifficulty(newDiff);
client.sendMiningJob(_this.jobManager.currentJob.getJobParams());
});
}

View File

@ -121,7 +121,7 @@ var varDiff = module.exports = function varDiff(options, poolDifficulty){
console.log('sending new difficutly ' + newDiff);
client.sendDifficulty(newDiff);
_this.emit('newDifficulty', client, newDiff);
});
};
};