mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-10-17 05:21:27 +02:00
Update to fix bug with the way that xmr-stak accepts jobs and the BT changes from the XMR pools.
This commit is contained in:
@@ -118,6 +118,7 @@ function Coin(data){
|
||||
|
||||
// Set this.blob equal to the BT blob that we get from upstream.
|
||||
this.blob = template.blocktemplate_blob;
|
||||
this.idHash = crypto.createHash('md5').update(template.blocktemplate_blob).digest('hex');
|
||||
// Set this.diff equal to the known diff for this block.
|
||||
this.difficulty = template.difficulty;
|
||||
// Set this.height equal to the known height for this block.
|
||||
|
||||
+4
-3
@@ -469,7 +469,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
|
||||
};
|
||||
this.getJob = function () {
|
||||
|
||||
if (this.lastBlockHeight === activeBlockTemplate.height && !this.newDiff && this.cachedJob !== null) {
|
||||
if (this.lastBlockHeight === activeBlockTemplate.height && activeBlockTemplate.idHash === this.validJobs.get(0).blockHash && !this.newDiff && this.cachedJob !== null) {
|
||||
return this.cachedJob;
|
||||
}
|
||||
|
||||
@@ -485,7 +485,8 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
|
||||
height: activeBlockTemplate.height,
|
||||
difficulty: this.difficulty,
|
||||
diffHex: this.diffHex,
|
||||
submissions: []
|
||||
submissions: [],
|
||||
blockHash: activeBlockTemplate.idHash
|
||||
};
|
||||
|
||||
this.validJobs.enq(newJob);
|
||||
@@ -892,7 +893,7 @@ if (cluster.isMaster) {
|
||||
|
||||
socket.on('data', function (d) {
|
||||
dataBuffer += d;
|
||||
if (Buffer.byteLength(dataBuffer, 'utf8') > 102400) { //10KB
|
||||
if (Buffer.byteLength(dataBuffer, 'utf8') > 10240) { //10KB
|
||||
dataBuffer = null;
|
||||
console.warn(threadName + 'Excessive packet size from: ' + socket.remoteAddress);
|
||||
socket.destroy();
|
||||
|
||||
Reference in New Issue
Block a user