Refactor indexer scheduling to avoid accumulating identical tasks

This commit is contained in:
Mononaut
2023-09-21 17:50:53 +01:00
parent ab8b557e73
commit 00887bc24b
3 changed files with 71 additions and 35 deletions

View File

@@ -206,7 +206,7 @@ class Server {
}
const newMempool = await bitcoinApi.$getRawMempool();
const numHandledBlocks = await blocks.$updateBlocks();
const pollRate = config.MEMPOOL.POLL_RATE_MS * (indexer.indexerRunning ? 10 : 1);
const pollRate = config.MEMPOOL.POLL_RATE_MS * (indexer.indexerIsRunning() ? 10 : 1);
if (numHandledBlocks === 0) {
await memPool.$updateMempool(newMempool, pollRate);
}