From 5dcbe96d5cae7376b71a06a5e0e3f80c9e3b9c56 Mon Sep 17 00:00:00 2001 From: Yeastplume Date: Wed, 4 Oct 2023 08:55:19 +0100 Subject: [PATCH] set tail height to include genesis (#3773) --- api/src/handlers/blocks_api.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/src/handlers/blocks_api.rs b/api/src/handlers/blocks_api.rs index 71defddb5..9165ba749 100644 --- a/api/src/handlers/blocks_api.rs +++ b/api/src/handlers/blocks_api.rs @@ -152,11 +152,18 @@ impl BlockHandler { max = BLOCK_TRANSFER_LIMIT; } let tail_height = self.get_tail_height()?; + let orig_start_height = start_height; if start_height < tail_height { start_height = tail_height; } + // In full archive node, tail will be set to 1, so include genesis block as well + // for consistency + if start_height == 1 && orig_start_height == 0 { + start_height = 0; + } + let mut result_set = BlockListing { last_retrieved_height: 0, blocks: vec![],