Fixed crash when running over a POS coin

Added emitLog for debugging the Block Submit
This commit is contained in:
Andrea Baccega 2014-02-14 12:03:25 +01:00
parent e1c143de18
commit bda4c57bd9
2 changed files with 19 additions and 1 deletions

View File

@ -199,6 +199,20 @@ var JobManager = module.exports = function JobManager(options){
return shareError([23, 'low difficulty share']);
}
}
if (!!blockHex) {
_this.emit('debugBlockShare',
{
'extraNonce1': extraNonce1,
'extraNonce2': extraNonce2,
'nTime': nTime,
'nonce': nonce,
'headerBuffer': headerBuffer.toString('hex'),
'headerHash': headerHash.toString('hex'),
'blockHex': blockHex,
'blockHash': blockHash
}
);
}
_this.emit('share', {
job: jobId,

View File

@ -110,7 +110,9 @@ var pool = module.exports = function pool(options, authorizeFn){
function SetupJobManager(){
_this.jobManager = new jobManager({
algorithm : options.algorithm,
address : options.address
address : options.address,
reward : options.reward,
txMessages: options.txMessages
});
_this.jobManager.on('newBlock', function(blockTemplate){
//Check if stratumServer has been initialized yet
@ -140,6 +142,8 @@ var pool = module.exports = function pool(options, authorizeFn){
});
});
}
}).on('debugBlockShare', function(debugData) {
emitLog('debugBlockSubmit', JSON.stringify(debugData));
});
}