From 1b7a0fd7ad6ee9fddf38ee7a0ae20f551c4467f9 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 19 Feb 2014 17:26:20 -0700 Subject: [PATCH] vardiff mode --- lib/pool.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/pool.js b/lib/pool.js index 552f8c9..92b9049 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -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"); }