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() uncleHashes[i] = uncle.Hash()
} }
fields["uncles"] = uncleHashes fields["uncles"] = uncleHashes
if block.Header().WithdrawalsHash != nil { if block.Withdrawals() != nil {
fields["withdrawals"] = block.Withdrawals() fields["withdrawals"] = block.Withdrawals()
} }
if block.Header().RequestsHash != nil { if block.Requests() != nil {
// Convert requests to hex. // Convert requests to hex.
hexreq := make([]hexutil.Bytes, len(block.Requests())) hexreq := make([]hexutil.Bytes, len(block.Requests()))
for i, req := range block.Requests() { for i, req := range block.Requests() {