From 647e1acb9105ae4053bd83a98656e81ffa5ec107 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Thu, 6 Jun 2019 10:37:55 +0800 Subject: [PATCH] internal: address the comment --- internal/ethapi/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 127a777e71..4e1a16710a 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -624,7 +624,7 @@ func (s *PublicBlockChainAPI) GetHeaderByNumber(ctx context.Context, blockNr rpc if header != nil && err == nil { response := rpcMarshalHeader(header) if blockNr == rpc.PendingBlockNumber { - // Pending blocks need to nil out a few fields + // Pending header need to nil out a few fields for _, field := range []string{"hash", "nonce", "miner"} { response[field] = nil } @@ -989,6 +989,7 @@ func rpcMarshalHeader(head *types.Header) map[string]interface{} { // transaction hashes. func RPCMarshalBlock(b *types.Block, inclTx bool, fullTx bool) (map[string]interface{}, error) { fields := rpcMarshalHeader(b.Header()) + fields["size"] = b.Size() if inclTx { formatTx := func(tx *types.Transaction) (interface{}, error) {