mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
fix withdrawal nil pointer dereference
This commit is contained in:
parent
ea7217b5dd
commit
6d443ca1d2
1 changed files with 7 additions and 2 deletions
|
|
@ -319,8 +319,13 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
|
||||||
reqHash := types.CalcRequestsHash(requests)
|
reqHash := types.CalcRequestsHash(requests)
|
||||||
header.RequestsHash = &reqHash
|
header.RequestsHash = &reqHash
|
||||||
}
|
}
|
||||||
|
var withdrawals []*types.Withdrawal
|
||||||
blockBody := &types.Body{Transactions: txes, Withdrawals: *block.BlockOverrides.Withdrawals}
|
if block.BlockOverrides.Withdrawals != nil {
|
||||||
|
withdrawals = *block.BlockOverrides.Withdrawals
|
||||||
|
} else {
|
||||||
|
withdrawals = []*types.Withdrawal{}
|
||||||
|
}
|
||||||
|
blockBody := &types.Body{Transactions: txes, Withdrawals: withdrawals}
|
||||||
chainHeadReader := &simChainHeadReader{ctx, sim.b}
|
chainHeadReader := &simChainHeadReader{ctx, sim.b}
|
||||||
b, err := sim.b.Engine().FinalizeAndAssemble(chainHeadReader, header, sim.state, blockBody, receipts)
|
b, err := sim.b.Engine().FinalizeAndAssemble(chainHeadReader, header, sim.state, blockBody, receipts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue