diff --git a/lib/jobManager.js b/lib/jobManager.js index eeecd64..b8dc2e8 100644 --- a/lib/jobManager.js +++ b/lib/jobManager.js @@ -205,7 +205,13 @@ var JobManager = module.exports = function JobManager(options) { //console.log('processShare ck2') - var nTimeInt = parseInt(util.reverseBuffer(new Buffer(nTime, 'hex')), 16); + var nTimeInt = parseInt(util.reverseBuffer(new Buffer(nTime, 'hex')).toString('hex'), 16); + + if (Number.isNaN(nTimeInt)) { + // console.log('Invalid nTime: ', nTimeInt, nTime) + return shareError([20, 'invalid ntime']) + } + if (nTimeInt < job.rpcData.curtime || nTimeInt > submitTime + 7200) { console.log('ntime out of range'); return shareError([20, 'ntime out of range']);