Skip to content

Commit 5dcbe96

Browse files
authored
set tail height to include genesis (#3773)
1 parent 5e2aa59 commit 5dcbe96

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

api/src/handlers/blocks_api.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,18 @@ impl BlockHandler {
152152
max = BLOCK_TRANSFER_LIMIT;
153153
}
154154
let tail_height = self.get_tail_height()?;
155+
let orig_start_height = start_height;
155156

156157
if start_height < tail_height {
157158
start_height = tail_height;
158159
}
159160

161+
// In full archive node, tail will be set to 1, so include genesis block as well
162+
// for consistency
163+
if start_height == 1 && orig_start_height == 0 {
164+
start_height = 0;
165+
}
166+
160167
let mut result_set = BlockListing {
161168
last_retrieved_height: 0,
162169
blocks: vec![],

0 commit comments

Comments
 (0)