Skip to content

Commit

Permalink
fix: don't sync block filter hashes if finalized checkpoint is too le…
Browse files Browse the repository at this point in the history
…ss than the last proved header
  • Loading branch information
yangby-cryptape committed Dec 28, 2023
1 parent fc45e35 commit 82a46db
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 82a46db

Please sign in to comment.