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:
Alexander Blair
2017-07-14 02:46:23 -07:00
parent ec01e5e05a
commit c9ead893cd
2 changed files with 5 additions and 3 deletions
+1
View File
@@ -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
View File
@@ -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();