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 ExtraNonceCounter = function(){
|
||||||
var instanceId = 31;
|
var instanceId = 31;
|
||||||
var counter = instanceId << 27;
|
var counter = instanceId << 27;
|
||||||
var size = util.packUInt32BE(counter).length;
|
var size = util.packUInt32BE(Math.abs(counter)).length;
|
||||||
|
|
||||||
this.next = function(){
|
this.next = function(){
|
||||||
var extraNonce = util.packUInt32BE(counter++);
|
var extraNonce = util.packUInt32BE(Math.abs(counter++));
|
||||||
return extraNonce.toString('hex');
|
return extraNonce.toString('hex');
|
||||||
};
|
};
|
||||||
this.size = function(){
|
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){
|
this.processShare = function(jobId, difficulty, extraNonce1, extraNonce2, nTime, nonce, ipAddress, workerName){
|
||||||
|
console.log(difficulty);
|
||||||
var shareError = function(error){
|
var shareError = function(error){
|
||||||
_this.emit('share', {
|
_this.emit('share', {
|
||||||
job: jobId,
|
job: jobId,
|
||||||
@ -181,7 +181,7 @@ var JobManager = module.exports = function JobManager(options){
|
|||||||
}
|
}
|
||||||
|
|
||||||
var nTimeInt = parseInt(nTime, 16);
|
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']);
|
return shareError([20, 'ntime out of range']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
0
scripts/blockNotify.js
Normal file → Executable file
0
scripts/blockNotify.js
Normal file → Executable file
Loading…
Reference in New Issue
Block a user