Skip to content

Commit

Permalink
fix: nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Jul 29, 2021
1 parent f137337 commit f826f36
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion eth/fetcher/block_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,17 @@ func (f *BlockFetcher) loop() {

case op := <-f.requeue:
// Re-queue blocks that have not been written due to fork block competition
log.Info("Re-queue blocks", "number", op.header.Number.Int64(), "hash", op.header.Hash().String())
number := int64(0)
hash := ""
if op.header != nil {
number = op.header.Number.Int64()
hash = op.header.Hash().String()
} else if op.block != nil {
number = op.block.Number().Int64()
hash = op.block.Hash().String()
}

log.Info("Re-queue blocks", "number", number, "hash", hash)
f.enqueue(op.origin, op.header, op.block)

case op := <-f.inject:
Expand Down

0 comments on commit f826f36

Please sign in to comment.