aboutsummaryrefslogtreecommitdiff
path: root/internal/ethapi
diff options
context:
space:
mode:
authorTodd Stock <[email protected]>2020-11-22 06:56:30 -0500
committerTodd Stock <[email protected]>2020-11-22 06:56:30 -0500
commit57cda741e1ecb09338cb9ebae572cb41d7920fc1 (patch)
treef59f296c73c07bc1c418fed8531569fa08fdf451 /internal/ethapi
parent7ce0588c5320894ddfae4069de45fe07d78b9f6f (diff)
parse string
Diffstat (limited to 'internal/ethapi')
-rw-r--r--internal/ethapi/api.go4
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) {