Skip to content
Permalink
Browse files

Update for CN/r

  • Loading branch information...
Snipa22 committed Mar 4, 2019
1 parent 0fcabef commit 76148a0f7da336bdd2f9bd8b1674a15265e5357c
Showing with 13 additions and 8 deletions.
  1. +12 −7 lib/pool.js
  2. +1 −1 package.json
@@ -500,7 +500,8 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
blob: blob,
job_id: newJob.id,
target: target,
id: this.id
id: this.id,
height: newJob.height
};
} else {
let blob = activeBlockTemplate.nextBlobWithChildNonce();
@@ -621,25 +622,29 @@ function processShare(miner, job, blockTemplate, params, sendReply) {
}
else {
convertedBlob = global.coinFuncs.convertBlob(shareBuffer);
hash = global.coinFuncs.cryptoNight(convertedBlob);
hash = multiHashing.cryptonight(convertedBlob, convertedBlob[0] >= 10 ? 13 : 8, job.height);
shareType = false;
}
if (hash.toString('hex') !== resultHash) {
if (job.height >= 1546000 && coinFuncs.isxmr) {
hash = multiHashing.cryptonight(convertedBlob, 0);
if (hash.toString("hex") === resultHash) {
if (multiHashing.cryptonight(convertedBlob, 0).toString("hex") === resultHash) {
console.error(threadName + "Bad hashing algo (CN/0) from miner " + miner.logString);
process.send({type: "invalidShare"});
miner.oldVersion = true;
return false;
}
hash = multiHashing.cryptonight(convertedBlob, 1);
if (hash.toString("hex") === resultHash) {
if (multiHashing.cryptonight(convertedBlob, 1).toString("hex") === resultHash) {
console.error(threadName + "Bad hashing algo (CN/1) from miner " + miner.logString);
process.send({type: "invalidShare"});
miner.oldVersion = true;
return false;
}
if (multiHashing.cryptonight(convertedBlob, 8).toString("hex") === resultHash) {
console.error(threadName + "Bad hashing algo (CN/2) from miner " + miner.logString);
process.send({type: "invalidShare"});
miner.oldVersion = true;
return false;
}
}
console.error(threadName + "Bad share from miner " + miner.logString);
process.send({type: 'invalidShare'});
@@ -857,7 +862,7 @@ if (cluster.isMaster) {
global.mysql.query("UPDATE pools SET last_checkin = ?, active = ? WHERE id = ?", [global.support.formatDate(Date.now()), true, global.config.pool_id]);
if (activeBlockTemplate) {
global.mysql.query("UPDATE pools SET blockIDTime = now(), blockID = ? where id = ?", [activeBlockTemplate.height, global.config.pool_id]);
}
}
global.config.ports.forEach(function (portData) {
global.mysql.query("UPDATE ports SET lastSeen = now(), miners = ? WHERE pool_id = ? AND network_port = ?", [minerCount[portData.port], global.config.pool_id, portData.port]);
});
@@ -43,7 +43,7 @@
},
"optionalDependencies": {
"cryptonote-util": "git://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0",
"cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git",
"cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v8.0.0",
"multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git#v0.1"
}
}

0 comments on commit 76148a0

Please sign in to comment.
You can’t perform that action at this time.