fix: Do not increase block counter when no block is read

This made ingest loop to infinitely increase the block number
This commit is contained in:
sprites0
2025-10-05 11:26:51 +00:00
parent b8bae7cde9
commit 12f366573e

View File

@ -18,7 +18,6 @@ pub struct ScanResult {
pub new_block_ranges: Vec<RangeInclusive<u64>>, pub new_block_ranges: Vec<RangeInclusive<u64>>,
} }
#[derive(Debug, Clone)]
pub struct ScanOptions { pub struct ScanOptions {
pub start_height: u64, pub start_height: u64,
pub only_load_ranges: bool, pub only_load_ranges: bool,
@ -122,9 +121,10 @@ impl Scanner {
if let Some((start, end)) = current_range { if let Some((start, end)) = current_range {
block_ranges.push(start..=end); block_ranges.push(start..=end);
} }
ScanResult { ScanResult {
path: line_stream.path.clone(), path: line_stream.path.clone(),
next_expected_height: last_height + 1, next_expected_height: last_height + current_range.is_some() as u64,
new_blocks, new_blocks,
new_block_ranges: block_ranges, new_block_ranges: block_ranges,
} }