I have a XMR proxy and check results with the job target before sending it to real pool. If I use mining software with the cryptonight-lite algorithm, my proxy accepts these hashes. Please help me to write function to validate results, so that it accepts only Cryptonight results and rejects Cryptonight-lite results.
In current time I use this function (JavaScript):
function checkResult(result, target) {
var targetDiff = parseInt(parseInt(target.length > 8 ? 'FFFFFFFFFFFFFFFF' : 'FFFFFFFF', 16) / parseInt(target.split(/(.{2})/).reverse().join(''), 16));
var resultDiff = parseInt(parseInt('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16) / parseInt(result.split(/(.{2})/).reverse().join(''), 16));
return resultDiff >= targetDiff;
}
It accepts Cryptonight and Cryptonight-lite hashes for XMR mining. I need this function to accept only Cryptonight hashes. Please help me to change this function. It seems I need other parameters besides target and result hash?