diff --git a/backend/src/api/mempool.ts b/backend/src/api/mempool.ts index db5de82b2..1be1faceb 100644 --- a/backend/src/api/mempool.ts +++ b/backend/src/api/mempool.ts @@ -38,7 +38,6 @@ class Mempool { constructor() { setInterval(this.updateTxPerSecond.bind(this), 1000); - setInterval(this.deleteExpiredTransactions.bind(this), 20000); } /** @@ -256,7 +255,7 @@ class Mempool { } } - private deleteExpiredTransactions() { + public deleteExpiredTransactions() { const now = new Date().getTime(); for (const tx in this.mempoolCache) { const lazyDeleteAt = this.mempoolCache[tx].deleteAfter; diff --git a/backend/src/index.ts b/backend/src/index.ts index ccba83be9..a34ffd21b 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -178,6 +178,7 @@ class Server { logger.debug(msg); } } + memPool.deleteExpiredTransactions(); await blocks.$updateBlocks(); await memPool.$updateMempool(); indexer.$run();