mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-12-03 12:04:04 +01:00
Security Update
Update to patch a small bug in the pool source. Thanks to MinerCircle for catching this.
This commit is contained in:
@@ -724,6 +724,13 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage) {
|
|||||||
}
|
}
|
||||||
job.submissions.push(params.nonce);
|
job.submissions.push(params.nonce);
|
||||||
} else {
|
} else {
|
||||||
|
if (!Number.isInteger(params.poolNonce) || !Number.isInteger(params.workerNonce)) {
|
||||||
|
console.warn(threadName + 'Malformed nonce: ' + JSON.stringify(params) + ' from ' + miner.logString);
|
||||||
|
miner.checkBan(false);
|
||||||
|
sendReply('Duplicate share');
|
||||||
|
global.database.storeInvalidShare(miner.invalidShareProto);
|
||||||
|
return;
|
||||||
|
}
|
||||||
let nonce_test = `${params.nonce}_${params.poolNonce}_${params.workerNonce}`;
|
let nonce_test = `${params.nonce}_${params.poolNonce}_${params.workerNonce}`;
|
||||||
if (job.submissions.indexOf(nonce_test) !== -1) {
|
if (job.submissions.indexOf(nonce_test) !== -1) {
|
||||||
console.warn(threadName + 'Duplicate share: ' + JSON.stringify(params) + ' from ' + miner.logString);
|
console.warn(threadName + 'Duplicate share: ' + JSON.stringify(params) + ' from ' + miner.logString);
|
||||||
|
|||||||
Reference in New Issue
Block a user