internal/ethapi: avoid copying header

This commit is contained in:
Felix Lange 2024-09-12 18:19:16 +02:00
parent 57f2ad1118
commit c1c8a2c46d

View file

@ -1433,10 +1433,10 @@ func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool, config *param
uncleHashes[i] = uncle.Hash()
}
fields["uncles"] = uncleHashes
if block.Header().WithdrawalsHash != nil {
if block.Withdrawals() != nil {
fields["withdrawals"] = block.Withdrawals()
}
if block.Header().RequestsHash != nil {
if block.Requests() != nil {
// Convert requests to hex.
hexreq := make([]hexutil.Bytes, len(block.Requests()))
for i, req := range block.Requests() {