From db4bf52596f9537ce9f6367f585420d408fc8e95 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Fri, 16 Dec 2022 17:43:37 +0100 Subject: [PATCH] Fix error 500 when querying /blocks using `"INDEXING_BLOCKS_AMOUNT": 0` --- backend/src/api/blocks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/api/blocks.ts b/backend/src/api/blocks.ts index 8c8272262..8c9fc86aa 100644 --- a/backend/src/api/blocks.ts +++ b/backend/src/api/blocks.ts @@ -677,7 +677,7 @@ class Blocks { } public async $getBlocks(fromHeight?: number, limit: number = 15): Promise { - let currentHeight = fromHeight !== undefined ? fromHeight : await blocksRepository.$mostRecentBlockHeight(); + let currentHeight = fromHeight !== undefined ? fromHeight : this.currentBlockHeight; const returnBlocks: BlockExtended[] = []; if (currentHeight < 0) {