vardiff mode

This commit is contained in:
Matt 2014-02-19 17:26:20 -07:00
parent 969292c111
commit 1b7a0fd7ad

View File

@ -51,9 +51,19 @@ var pool = module.exports = function pool(options, authorizeFn){
if (_this.stratumServer)
RequestDifficulty(function(){});
}).on('newDifficulty', function(client, newDiff) {
// We request to set the newDiff @ the next difficulty retarget
// (which should happen when a new job comes in - AKA BLOCK)
client.enqueueNextDifficulty(newDiff);
if (options.varDiff.mode === 'fast'){
client.sendDifficulty(newDiff);
var job = _this.jobManager.currentJob.getJobParams();
job[8] = false;
client.sendMiningJob(job);
}
else{
// We request to set the newDiff @ the next difficulty retarget
// (which should happen when a new job comes in - AKA BLOCK)
client.enqueueNextDifficulty(newDiff);
}
});
emitLog("system", "VarDiff enabled and setup");
}