diff --git a/backend/src/api/mempool-blocks.ts b/backend/src/api/mempool-blocks.ts index c753d2293..ca318bb5d 100644 --- a/backend/src/api/mempool-blocks.ts +++ b/backend/src/api/mempool-blocks.ts @@ -374,6 +374,10 @@ class MempoolBlocks { } public async $rustUpdateBlockTemplates(newMempool: { [txid: string]: MempoolTransactionExtended }, added: MempoolTransactionExtended[], removed: MempoolTransactionExtended[]): Promise { + // sanity check to avoid approaching uint32 uid overflow + if (this.nextUid > 4_000_000_000) { + this.resetRustGbt(); + } if (!this.rustInitialized) { // need to reset the worker await this.$rustMakeBlockTemplates(newMempool, true);