mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
ethclient: don't crash if server returns null uncle header
It should never return null for a known uncle, but even if it does we can't just crash.
This commit is contained in:
parent
2dcf75a722
commit
4cb29bde2e
1 changed files with 3 additions and 0 deletions
|
|
@ -123,6 +123,9 @@ func (ec *Client) getBlock(ctx context.Context, method string, args ...interface
|
|||
if reqs[i].Error != nil {
|
||||
return nil, reqs[i].Error
|
||||
}
|
||||
if uncles[i] == nil {
|
||||
return nil, fmt.Errorf("got null header for uncle %d of block %x", i, body.Hash[:])
|
||||
}
|
||||
}
|
||||
}
|
||||
return types.NewBlockWithHeader(head).WithBody(body.Transactions, uncles), nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue