Fixed nTime check. We were comparing the nTime(hex) with an int. So string comparison were going on!
This commit is contained in:
parent
90bdc9a250
commit
04ddb472ee
|
@ -17,10 +17,10 @@ var blockTemplate = require('./blockTemplate.js');
|
|||
var ExtraNonceCounter = function(){
|
||||
var instanceId = 31;
|
||||
var counter = instanceId << 27;
|
||||
var size = util.packUInt32BE(counter).length;
|
||||
var size = util.packUInt32BE(Math.abs(counter)).length;
|
||||
|
||||
this.next = function(){
|
||||
var extraNonce = util.packUInt32BE(counter++);
|
||||
var extraNonce = util.packUInt32BE(Math.abs(counter++));
|
||||
return extraNonce.toString('hex');
|
||||
};
|
||||
this.size = function(){
|
||||
|
@ -152,7 +152,7 @@ var JobManager = module.exports = function JobManager(options){
|
|||
};
|
||||
|
||||
this.processShare = function(jobId, difficulty, extraNonce1, extraNonce2, nTime, nonce, ipAddress, workerName){
|
||||
|
||||
console.log(difficulty);
|
||||
var shareError = function(error){
|
||||
_this.emit('share', {
|
||||
job: jobId,
|
||||
|
@ -181,7 +181,7 @@ var JobManager = module.exports = function JobManager(options){
|
|||
}
|
||||
|
||||
var nTimeInt = parseInt(nTime, 16);
|
||||
if (nTimeInt < job.rpcData.curtime || nTime > submitTime + 7200) {
|
||||
if (nTimeInt < job.rpcData.curtime || nTimeInt > submitTime + 7200) {
|
||||
return shareError([20, 'ntime out of range']);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue