mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
fix: even if no body, should return block with header
This commit is contained in:
parent
58ae1df684
commit
cfd9c4df04
1 changed files with 1 additions and 1 deletions
|
|
@ -763,7 +763,7 @@ func ReadBlock(db ethdb.Reader, hash common.Hash, number uint64) *types.Block {
|
||||||
}
|
}
|
||||||
body := ReadBody(db, hash, number)
|
body := ReadBody(db, hash, number)
|
||||||
if body == nil {
|
if body == nil {
|
||||||
return nil
|
return types.NewBlockWithHeader(header)
|
||||||
}
|
}
|
||||||
return types.NewBlockWithHeader(header).WithBody(body.Transactions, body.Uncles).WithWithdrawals(body.Withdrawals)
|
return types.NewBlockWithHeader(header).WithBody(body.Transactions, body.Uncles).WithWithdrawals(body.Withdrawals)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue