Skip to content

Commit

Permalink
set tail height to include genesis (#3773)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeastplume authored Oct 4, 2023
1 parent 5e2aa59 commit 5dcbe96
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/src/handlers/blocks_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![],
Expand Down

0 comments on commit 5dcbe96

Please sign in to comment.