Skip to content

Commit

Permalink
Merge pull request #169 from yangby-cryptape/bugfix/sync-too-many-blo…
Browse files Browse the repository at this point in the history
…ck-filter-hashes

fix: don't sync block filter hashes if finalized checkpoint is too less than the last proved header
  • Loading branch information
quake authored Dec 29, 2023
2 parents fc45e35 + 82a46db commit 86865db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/protocols/light_client/peers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,9 @@ impl Peers {
if check_point_number == finalized_check_point_number {
let proved_number = state.get_last_header().header().number();
let last_number = latest_block_filter_hashes.get_last_number();
if last_number < proved_number {
if last_number < proved_number
&& proved_number - last_number < self.check_point_interval * 2
{
Some((*peer_index, last_number + 1))
} else {
None
Expand Down

0 comments on commit 86865db

Please sign in to comment.