From 79339c05893cef423c5453c24b775d9fb61a0937 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Tue, 28 Jan 2025 06:45:03 +0100 Subject: [PATCH] [indexing] exit early when we're unable to index pools definition sha --- backend/src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/src/index.ts b/backend/src/index.ts index dc6a8ae1a..b43e685dc 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -152,6 +152,11 @@ class Server { this.setUpWebsocketHandling(); await poolsUpdater.updatePoolsJson(); // Needs to be done before loading the disk cache because we sometimes wipe it + if (config.DATABASE.ENABLED === true && config.MEMPOOL.ENABLED && ['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK) && !poolsUpdater.currentSha) { + logger.err(`Failed to retreive pools-v2.json sha, cannot run block indexing. Please make sure you've set valid urls in your mempool-config.json::MEMPOOL::POOLS_JSON_URL and mempool-config.json::MEMPOOL::POOLS_JSON_TREE_UR, aborting now`); + return process.exit(1); + } + await syncAssets.syncAssets$(); await mempoolBlocks.updatePools$(); if (config.MEMPOOL.ENABLED) {