Fixed duplicate share vulnerability with the nonce

zone117x fix
pull/26/head
pmitchev 2014-09-30 18:55:39 +03:00
parent cd36f84e2e
commit 780b5255fa
1 changed files with 4 additions and 0 deletions

View File

@ -518,7 +518,11 @@ function handleMinerMethod(method, params, ip, portData, sendReply, pushMessage)
return;
}
params.nonce = params.nonce.substr(0, 8).toLowerCase();
if (job.submissions.indexOf(params.nonce) !== -1){
var minerText = miner ? (' ' + miner.login + '@' + miner.ip) : '';
log('warn', logSystem, 'Duplicate share: ' + JSON.stringify(params) + ' from ' + minerText);
sendReply('Duplicate share');
return;
}