Skip to content

Commit

Permalink
UT: fix UT crash in finalizeHeighter
Browse files Browse the repository at this point in the history
  • Loading branch information
brilliant-lx committed Sep 6, 2023
1 parent d201e60 commit f08b2d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,11 @@ func newHandler(config *handlerConfig) (*handler, error) {
return h.chain.CurrentBlock().NumberU64()
}
finalizeHeighter := func() uint64 {
return h.chain.CurrentFinalBlock().Number.Uint64()
fblock := h.chain.CurrentFinalBlock()
if fblock == nil {
return 0
}
return fblock.Number.Uint64()
}
inserter := func(blocks types.Blocks) (int, error) {
// All the block fetcher activities should be disabled
Expand Down

0 comments on commit f08b2d8

Please sign in to comment.