mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-04-26 04:45:08 +08:00
fix: edge case when requests processed out of order
This commit is contained in:
@@ -169,7 +169,6 @@ pub async fn download_and_pipeline_blocks(
|
||||
while let Ok(message) = block_compressed_rx.try_recv() {
|
||||
match message {
|
||||
Some((block_height, block, compacted_block)) => {
|
||||
blocks_processed += 1;
|
||||
new_blocks.push((block_height, block, compacted_block));
|
||||
// Max batch size: 10_000 blocks
|
||||
if new_blocks.len() >= 10_000 {
|
||||
@@ -216,6 +215,7 @@ pub async fn download_and_pipeline_blocks(
|
||||
vec![],
|
||||
));
|
||||
}
|
||||
blocks_processed += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -235,6 +235,7 @@ pub async fn download_and_pipeline_blocks(
|
||||
blocks,
|
||||
));
|
||||
}
|
||||
blocks_processed += 1;
|
||||
}
|
||||
}
|
||||
()
|
||||
|
||||
Reference in New Issue
Block a user