Skip to content

Commit

Permalink
fix: check parent hash of disconnected headers (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 authored Jul 24, 2024
1 parent eee1b05 commit 3d8df4a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/bsc/engine/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,13 @@ impl<
}
disconnected_headers.push(sealed_header.clone());
}

// check last header.parent_hash is match the trusted header
if !disconnected_headers.is_empty() &&
disconnected_headers.last().unwrap().parent_hash != trusted_header.hash()
{
continue;
}
};

// cache header and block
Expand Down

0 comments on commit 3d8df4a

Please sign in to comment.