Skip to content

Commit

Permalink
return [] instead of null for withdrawals (erigontech#7279)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 authored Apr 7, 2023
1 parent 9690228 commit c60a6a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions turbo/adapter/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,11 @@ func RPCMarshalBlockExDeprecated(block *types.Block, inclTx bool, fullTx bool, b
fields["withdrawals"] = block.Withdrawals()
}

// Ensure that withdrawals is not null at all times.
if fields["withdrawals"] == nil {
fields["withdrawals"] = []*types.Withdrawal{}
}

return fields, nil
}

Expand Down

0 comments on commit c60a6a2

Please sign in to comment.