From 2f4425a087fd208caff138e13424574c7e5a037a Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 19 Feb 2014 23:46:14 -0700 Subject: [PATCH] Updated readme setup options --- README.md | 5 +++++ lib/pool.js | 12 ++++++------ package.json | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 286314e..37044e4 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ var pool = stratum.createPool({ txMessages: false //or true address: "nhfNedMmQ1Rjb62znwaiJgFhL3f4NQztSp", stratumPort: 3334, + //instanceId: 37, //I recommend not to use this option as a crypto-random one will be generated difficulty: 32, blockRefreshInterval: 2, //seconds daemon: { @@ -98,6 +99,10 @@ var pool = stratum.createPool({ targetTime: 30, //target time per share (i.e. try to get 1 share per this many seconds) retargetTime: 120, //check to see if we should retarget every this many seconds variancePercent: 20 //allow average time to very this % from target without retarget + + /* Enabling this option will queue client difficulty updates to be sent when a new job + is available. Otherwise new difficulties will be sent immediately. */ + //mode: 'safe' } }, function(ip, workerName, password, callback){ //stratum authorization function diff --git a/lib/pool.js b/lib/pool.js index 92b9049..baf051f 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -53,17 +53,17 @@ var pool = module.exports = function pool(options, authorizeFn){ }).on('newDifficulty', function(client, newDiff) { - if (options.varDiff.mode === 'fast'){ + if (options.varDiff.mode === 'safe'){ + // We request to set the newDiff @ the next difficulty retarget + // (which should happen when a new job comes in - AKA BLOCK) + client.enqueueNextDifficulty(newDiff); + } + else{ 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"); } diff --git a/package.json b/package.json index e8e568a..0cc1153 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stratum-pool", - "version": "0.0.7", + "version": "0.0.8", "author": "Matthew Little", "description": "High performance Stratum poolserver in Node.js", "contributors": [