diff options
Diffstat (limited to 'internal/ethapi')
-rw-r--r-- | internal/ethapi/api.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 1a95d9b..77efcab 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1161,7 +1161,9 @@ func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool) (map[string]i fields := RPCMarshalHeader(block.Header()) fields["size"] = hexutil.Uint64(block.Size()) - fields["blockExtraData"] = hexutil.Bytes(block.ExtraData()) + if len(block.ExtraData()) != 0 { + fields["blockExtraData"] = hexutil.Encode(block.ExtraData()) + } if inclTx { formatTx := func(tx *types.Transaction) (interface{}, error) { |