mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
Fix panic when fetching block in case of reorg (#1259)
This commit is contained in:
parent
a0acefc04c
commit
c0d1fbb86a
1 changed files with 6 additions and 0 deletions
|
|
@ -735,6 +735,12 @@ func (s *Service) assembleBlockStats(block *types.Block) *blockStats {
|
|||
}
|
||||
}
|
||||
|
||||
// It's weird, but it's possible that the block is nil here.
|
||||
// even though the check for error is done above.
|
||||
if block == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
header = block.Header()
|
||||
td = fullBackend.GetTd(context.Background(), header.Hash())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue