Refresh jobs when parent template blob changes
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 54s
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 54s
This commit is contained in:
@@ -198,7 +198,10 @@ process.on('message', function (message) {
|
||||
let new_hash = Buffer.alloc(32);
|
||||
buffer.copy(new_hash, 0, previousOffset, 39);
|
||||
try {
|
||||
if (!currentBlockTemplate[0] || new_hash.toString('hex') !== currentBlockTemplate[0].prev_hash.toString('hex') || (currentBlockTemplate[0].num_transactions == 0 && message.block.num_transactions > 0)) {
|
||||
const prevHashChanged = !currentBlockTemplate[0] || new_hash.toString('hex') !== currentBlockTemplate[0].prev_hash.toString('hex');
|
||||
const txCountBecameNonZero = currentBlockTemplate[0] && currentBlockTemplate[0].num_transactions == 0 && message.block.num_transactions > 0;
|
||||
const templateBlobChanged = currentBlockTemplate[0] && message.block.blocktemplate_blob !== currentBlockTemplate[0].blocktemplate_blob;
|
||||
if (!currentBlockTemplate[0] || prevHashChanged || txCountBecameNonZero || templateBlobChanged) {
|
||||
log('info', logSystem, 'New %s block to mine at height %d w/ difficulty of %d (%d transactions)', [miningBackends.getActiveMiningBackend().coin, message.block.height, message.block.difficulty, (message.block.num_transactions || 0)]);
|
||||
processBlockTemplate(message.block);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user