Fix unmineable tx handling

This commit is contained in:
Mononaut committed 2024-01-09 16:26:05 +00:00
1 parent d665d2a12c
commit 89d37f0058
2 files changed
+72 -68

No files matched your search

+6 -5
View File
@@ -432,15 +432,16 @@ class MempoolBlocks {
this.nextUid,
),
);
const resultMempoolSize = blocks.reduce((total, block) => total + block.length, 0);
if (mempoolSize !== resultMempoolSize) {
throw new Error('GBT returned wrong number of transactions, cache is probably out of sync');
} else {
//// different number of transactions is now expected, if any were unmineable
// const resultMempoolSize = blocks.reduce((total, block) => total + block.length, 0);
// if (mempoolSize !== resultMempoolSize) {
// throw new Error('GBT returned wrong number of transactions, cache is probably out of sync');
// } else {
const processed = this.processBlockTemplates(newMempool, blocks, blockWeights, rates, clusters, accelerations, accelerationPool, true);
this.removeUids(removedUids);
logger.debug(`RUST updateBlockTemplates completed in ${(Date.now() - start)/1000} seconds`);
return processed;
}
// }
} catch (e) {
logger.err('RUST updateBlockTemplates failed. ' + (e instanceof Error ? e.message : e));
this.resetRustGbt();