Change miner trust probability & penalty if wrong share submitted

pull/25/head
fancoder 2014-09-08 20:32:43 +04:00
parent c822d8a53d
commit a03834f153
1 changed files with 6 additions and 4 deletions

View File

@ -536,10 +536,7 @@ function handleMinerMethod(method, params, ip, portData, sendReply, pushMessage)
var shareAccepted = processShare(miner, job, blockTemplate, params.nonce, params.result);
miner.checkBan(shareAccepted);
if (!shareAccepted){
sendReply('Low difficulty share');
return;
}
if (shareTrustEnabled){
if (shareAccepted){
miner.trust.probability -= shareTrustStepFloat;
@ -554,6 +551,11 @@ function handleMinerMethod(method, params, ip, portData, sendReply, pushMessage)
miner.trust.penalty = config.poolServer.shareTrust.penalty;
}
}
if (!shareAccepted){
sendReply('Low difficulty share');
return;
}
var now = Date.now() / 1000 | 0;
miner.shareTimeRing.append(now - miner.lastShareTime);