mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 02:49:55 +00:00
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:
@ -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,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user