From b965b2d61d07d9e30151c94a1795df1bc3c7ac0c Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 20 Mar 2014 12:20:08 -0600 Subject: [PATCH] Another fix where vardiff was breaking things --- lib/pool.js | 4 +++- lib/varDiff.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pool.js b/lib/pool.js index ebc2db6..e914ba4 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -77,7 +77,8 @@ var pool = module.exports = function pool(options, authorizeFn){ function SetupVarDiff(){ Object.keys(options.ports).forEach(function(port) { - _this.setVarDiff(port, new varDiff(port, options.ports[port].varDiff)); + if (options.ports[port].varDiff) + _this.setVarDiff(port, new varDiff(port, options.ports[port].varDiff)); }); } @@ -416,6 +417,7 @@ var pool = module.exports = function pool(options, authorizeFn){ var processedNewBlock = _this.jobManager.processTemplate(result.response, publicKeyBuffer); if (processedNewBlock) { + Object.keys(_this.varDiff).forEach(function(port){ _this.varDiff[port].setNetworkDifficulty(_this.jobManager.currentJob.difficulty); }); diff --git a/lib/varDiff.js b/lib/varDiff.js index b9622fc..40518d0 100644 --- a/lib/varDiff.js +++ b/lib/varDiff.js @@ -48,7 +48,7 @@ var varDiff = module.exports = function varDiff(port, varDiffOptions){ var bufferSize, tMin, tMax; - if (!varDiffOptions) return; + //if (!varDiffOptions) return; var variance = varDiffOptions.targetTime * (varDiffOptions.variancePercent / 100);