Skip to content

Commit

Permalink
fix: download matched blocks even previous download are not finished
Browse files Browse the repository at this point in the history
  • Loading branch information
yangby-cryptape committed Oct 31, 2024
1 parent 51d2895 commit 32af596
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/protocols/filter/block_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl FilterProtocol {
{
debug!(
"try recover matched blocks from storage, start_number={}, \
blocks_count={}, matched_count: {}",
blocks_count={}, matched_count: {}",
db_start_number,
blocks_count,
matched_blocks.len(),
Expand All @@ -151,21 +151,21 @@ impl FilterProtocol {
// recover matched blocks from storage
self.peers
.add_matched_blocks(&mut matched_blocks, db_blocks);
let tip_header = self.storage.get_tip_header();
prove_or_download_matched_blocks(
Arc::clone(&self.peers),
&tip_header,
&matched_blocks,
nc.as_ref(),
INIT_BLOCKS_IN_TRANSIT_PER_PEER,
}
let tip_header = self.storage.get_tip_header();
prove_or_download_matched_blocks(
Arc::clone(&self.peers),
&tip_header,
&matched_blocks,
nc.as_ref(),
INIT_BLOCKS_IN_TRANSIT_PER_PEER,
);
if could_ask_more {
debug!(
"send get block filters to {}, start_number={}",
peer, start_number
);
if could_ask_more {
debug!(
"send get block filters to {}, start_number={}",
peer, start_number
);
self.send_get_block_filters(nc, *peer, start_number);
}
self.send_get_block_filters(nc, *peer, start_number);
}
} else if self.should_ask(immediately) && could_ask_more {
debug!(
Expand Down

0 comments on commit 32af596

Please sign in to comment.