diff --git a/backend/src/api/blocks.ts b/backend/src/api/blocks.ts index 3f2a7b49e..d110186f5 100644 --- a/backend/src/api/blocks.ts +++ b/backend/src/api/blocks.ts @@ -600,9 +600,11 @@ class Blocks { * Index a block if it's missing from the database. Returns the block after indexing */ public async $indexBlock(height: number): Promise { - const dbBlock = await blocksRepository.$getBlockByHeight(height); - if (dbBlock != null) { - return prepareBlock(dbBlock); + if (Common.indexingEnabled()) { + const dbBlock = await blocksRepository.$getBlockByHeight(height); + if (dbBlock !== null) { + return prepareBlock(dbBlock); + } } const blockHash = await bitcoinApi.$getBlockHash(height);