Skip to content

Commit

Permalink
fix: no import blocks before or equal to the finalized height (bnb-ch…
Browse files Browse the repository at this point in the history
  • Loading branch information
buddh0 authored Apr 17, 2024
1 parent 90eb5b3 commit cbcd26c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eth/fetcher/block_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ func (f *BlockFetcher) loop() {
}
// Import any queued blocks that could potentially fit
height := f.chainHeight()
finalizedHeight := f.chainFinalizedHeight()
for !f.queue.Empty() {
op := f.queue.PopItem()
hash := op.hash()
Expand All @@ -380,6 +379,7 @@ func (f *BlockFetcher) loop() {
break
}
// Otherwise if fresh and still unknown, try and import
finalizedHeight := f.chainFinalizedHeight()
if (number+maxUncleDist < height) || number <= finalizedHeight || (f.light && f.getHeader(hash) != nil) || (!f.light && f.getBlock(hash) != nil) {
f.forgetBlock(hash)
continue
Expand Down

0 comments on commit cbcd26c

Please sign in to comment.