fix: edge case when requests processed in order

This commit is contained in:
Ludo Galabru
2023-08-24 18:13:43 +02:00
parent a35cea2b54
commit 8c4325f721

View File

@@ -208,7 +208,7 @@ pub async fn download_and_pipeline_blocks(
}
// Early "continue"
if inbox.is_empty() {
if !ooo_compacted_blocks.is_empty() {
blocks_processed += ooo_compacted_blocks.len() as u64;
if let Some(ref blocks_tx) = blocks_post_processor_commands_tx {
let _ = blocks_tx.send(PostProcessorCommand::ProcessBlocks(
@@ -216,6 +216,9 @@ pub async fn download_and_pipeline_blocks(
vec![],
));
}
}
if inbox.is_empty() {
continue;
}
@@ -229,7 +232,6 @@ pub async fn download_and_pipeline_blocks(
}
if !blocks.is_empty() {
blocks_processed += blocks.len() as u64;
if let Some(ref blocks_tx) = blocks_post_processor_commands_tx {
let _ = blocks_tx.send(PostProcessorCommand::ProcessBlocks(
compacted_blocks,
@@ -237,6 +239,10 @@ pub async fn download_and_pipeline_blocks(
));
}
}
if inbox_cursor > end_block {
stop_runloop = true;
}
}
()
})