Open ghost opened 5 years ago
jobRebroadcastTimeout does not update correctly the mining difficulty if the mining difficulty in THE SAME BLOCK changes with time.
so if the mining difficulty is adjusted with time, like in some adjusted darkgravitywave algorithm that scale difficulty down with TIME ( for example, progressively lower difficulty if there is a long stale tip..... ) ..... the pool dosent brodcast that info, and the miners keeps trying to mine a higher difficulty block, and if a block is found, the difficulty bits dosent match the pow difficulty bits.
When a new block is found, the pool sends a new getblocktemplate and checks the new difficulty for the next block. jobrebrodcast timeout should also do this.
Or a new option could be added for coins that changes difficulty in the same block over time.
.on('broadcastTimeout', function(){ emitLog('No new blocks for ' + options.jobRebroadcastTimeout + ' seconds - updating transactions & rebroadcasting work');
GetBlockTemplate(function(error, rpcData, processedBlock){
emitLog('This is the value of rpcData : ', rpcdata);
emitLog('Its supposed to return if there is an error or a processedBlock .... will it return ?');
if (error || processedBlock) return;
emitLog('no, did not return...');
_this.jobManager.updateCurrentJob(rpcData);
emitLog('sent updateCurrentJob(rpcdata) to jobManager');
});
RESULT :
2019-03-09 12:38:56 [Pool] [lightningcash gold] (Thread 8) No new blocks for 30 seconds - updating transactions & rebroadcasting work /home/merlin/nomp/node_modules/stratum-pool/lib/pool.js:476 emitLog('This is the value of rpcData : ', rpcdata); ^
ReferenceError: rpcdata is not defined
at /home/merlin/nomp/node_modules/stratum-pool/lib/pool.js:476:46
at /home/merlin/nomp/node_modules/stratum-pool/lib/pool.js:592:21
at itemFinished (/home/merlin/nomp/node_modules/stratum-pool/lib/daemon.js:156:36)
at /home/merlin/nomp/node_modules/stratum-pool/lib/daemon.js:169:17
at parseJson (/home/merlin/nomp/node_modules/stratum-pool/lib/daemon.js:85:17)
at IncomingMessage.
Further debugging gives this :
2019-03-09 13:02:32 [Pool] [lightningcash gold] (Thread 5) No new blocks for 30 seconds - updating transactions & rebroadcasting work
2019-03-09 13:02:32 [Pool] [lightningcash gold] (Thread 5) Its supposed to return if there is an error or a processedBlock .... will it return ?
2019-03-09 13:02:32 [Pool] [lightningcash gold] (Thread 5) no, did not return... ( normal here.... )
2019-03-09 13:02:32 [Pool] [lightningcash gold] (Thread 5) This is the value of result : (empty ???)
2019-03-09 13:02:32 [Pool] [lightningcash gold] (Thread 5) sent updateCurrentJob(result) to jobManager