fix withdrawal nil pointer dereference

This commit is contained in:
Rez 2025-03-20 07:10:47 +11:00
parent ea7217b5dd
commit 6d443ca1d2
No known key found for this signature in database

View file

@ -319,8 +319,13 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
reqHash := types.CalcRequestsHash(requests)
header.RequestsHash = &reqHash
}
blockBody := &types.Body{Transactions: txes, Withdrawals: *block.BlockOverrides.Withdrawals}
var withdrawals []*types.Withdrawal
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}
b, err := sim.b.Engine().FinalizeAndAssemble(chainHeadReader, header, sim.state, blockBody, receipts)
if err != nil {