diff --git a/lib/pool.js b/lib/pool.js index 2602a5d..6002a2b 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -394,7 +394,13 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer this.updateDifficulty = function(){ if (this.hashes > 0) { - this.setNewDiff(Math.floor(this.hashes / (Math.floor((Date.now() - this.connectTime) / 1000))) * global.config.pool.targetTime); + let newDiff = 0; + if (this.proxy){ + newDiff = Math.floor(Math.floor(this.hashes / (Math.floor((Date.now() - this.connectTime) / 1000))) * global.config.pool.targetTime/10); + } else { + newDiff = Math.floor(this.hashes / (Math.floor((Date.now() - this.connectTime) / 1000))) * global.config.pool.targetTime; + } + this.setNewDiff(newDiff); } else { this.updateDifficultyOld(); } @@ -403,7 +409,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer this.setNewDiff = function (difficulty) { this.newDiff = Math.round(difficulty); debug(threadName + "Difficulty: " + this.newDiff + " For: " + this.logString + " Time Average: " + this.shareTimeBuffer.average(this.lastShareTime) + " Entries: " + this.shareTimeBuffer.size() + " Sum: " + this.shareTimeBuffer.sum()); - if (this.newDiff > global.config.pool.maxDifficulty) { + if (this.newDiff > global.config.pool.maxDifficulty && !this.proxy) { this.newDiff = global.config.pool.maxDifficulty; } if (this.difficulty === this.newDiff) { @@ -876,7 +882,7 @@ if (cluster.isMaster) { socket.on('data', function (d) { dataBuffer += d; - if (Buffer.byteLength(dataBuffer, 'utf8') > 10240) { //10KB + if (Buffer.byteLength(dataBuffer, 'utf8') > 102400) { //10KB dataBuffer = null; console.warn(threadName + 'Excessive packet size from: ' + socket.remoteAddress); socket.destroy();