Skip to content
Permalink
Browse files

Pool-Update: RX/0

Adds the RX/0 code to the system to handle the change over
  • Loading branch information
Alexander Blair
Alexander Blair committed Nov 30, 2019
1 parent 76148a0 commit 2326257ac1b9dcadddfba2b6bae37ea84d486fee
Showing with 17 additions and 3 deletions.
  1. +5 −0 lib/coins/xmr.js
  2. +11 −2 lib/pool.js
  3. +1 −1 package.json
@@ -148,6 +148,11 @@ function Coin(data){
this.clientNonceLocation = this.reserveOffset + 12;
// The clientPoolLocation is for multi-thread/multi-server pools to handle the nonce for each of their tiers.
this.clientPoolLocation = this.reserveOffset + 8;
if (template.seed_hash) {
this.seedHash = Buffer.from(template.seed_hash, 'hex');
} else {
this.seedHash = Buffer.from('00', 'hex');
}
this.nextBlob = function () {
// Write a 32 bit integer, big-endian style to the 0 byte of the reserve offset.
this.buffer.writeUInt32BE(++this.extraNonce, this.reserveOffset);
@@ -492,6 +492,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
difficulty: this.difficulty,
diffHex: this.diffHex,
submissions: [],
seed_hash: activeBlockTemplate.seedHash ? activeBlockTemplate.seedHash.toString('hex') : null,
blockHash: activeBlockTemplate.idHash
};

@@ -501,6 +502,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
job_id: newJob.id,
target: target,
id: this.id,
seed_hash: activeBlockTemplate.seedHash ? activeBlockTemplate.seedHash.toString('hex') : null,
height: newJob.height
};
} else {
@@ -519,6 +521,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
diffHex: this.diffHex,
clientPoolLocation: activeBlockTemplate.clientPoolLocation,
clientNonceLocation: activeBlockTemplate.clientNonceLocation,
seed_hash: activeBlockTemplate.seedHash ? activeBlockTemplate.seedHash.toString('hex') : null,
submissions: []
};
this.validJobs.enq(newJob);
@@ -531,6 +534,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
client_pool_offset: activeBlockTemplate.clientPoolLocation,
target_diff: this.difficulty,
target_diff_hex: this.diffHex,
seed_hash: activeBlockTemplate.seedHash ? activeBlockTemplate.seedHash.toString('hex') : null,
job_id: newJob.id,
id: this.id
};
@@ -622,8 +626,13 @@ function processShare(miner, job, blockTemplate, params, sendReply) {
}
else {
convertedBlob = global.coinFuncs.convertBlob(shareBuffer);
hash = multiHashing.cryptonight(convertedBlob, convertedBlob[0] >= 10 ? 13 : 8, job.height);
shareType = false;
if (blockTemplate.seedHash && blockTemplate.seedHash.length == 32) {
hash = multiHashing.randomx(convertedBlob, blockTemplate.seedHash, 0);
shareType = false;
} else {
hash = multiHashing.cryptonight(convertedBlob, convertedBlob[0] >= 10 ? 13 : 8, job.height);
shareType = false;
}
}
if (hash.toString('hex') !== resultHash) {
if (job.height >= 1546000 && coinFuncs.isxmr) {
@@ -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#v8.0.0",
"cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#865a1f18e7dd5cf0513ae6becfdbeba3a10c9fb9",
"multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git#v0.1"
}
}

0 comments on commit 2326257

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