Fix error 500 when querying /blocks using "INDEXING_BLOCKS_AMOUNT": 0

This commit is contained in:
nymkappa 2022-12-16 17:43:37 +01:00
parent fdec1f8959
commit f177ee44ec

View File

@ -677,7 +677,7 @@ class Blocks {
}
public async $getBlocks(fromHeight?: number, limit: number = 15): Promise<BlockExtended[]> {
let currentHeight = fromHeight !== undefined ? fromHeight : await blocksRepository.$mostRecentBlockHeight();
let currentHeight = fromHeight !== undefined ? fromHeight : this.currentBlockHeight;
const returnBlocks: BlockExtended[] = [];
if (currentHeight < 0) {