Merge pull request #26 from pmitchev/master

Fixed duplicate share vulnerability with the nonce
master
fancoder 2014-10-01 13:13:19 +04:00
commit 3e0311f4aa
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;
}