From 53d3e48198c2dea3a0f74369222a9d8d49834d53 Mon Sep 17 00:00:00 2001 From: "lightclient@protonmail.com" Date: Fri, 27 Jan 2023 19:17:20 +0100 Subject: [PATCH] internal/ethapi: always add block withdrawal objects if present --- internal/ethapi/api.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 1ac9c5faa74a..4fa5b9e67e36 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1246,8 +1246,6 @@ func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool, config *param } } fields["transactions"] = transactions - // inclTx also expands withdrawals - fields["withdrawals"] = block.Withdrawals() } uncles := block.Uncles() uncleHashes := make([]common.Hash, len(uncles)) @@ -1255,7 +1253,9 @@ func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool, config *param uncleHashes[i] = uncle.Hash() } fields["uncles"] = uncleHashes - + if block.Header().WithdrawalsHash != nil { + fields["withdrawals"] = block.Withdrawals() + } return fields, nil }