internal: address the comment

This commit is contained in:
rjl493456442 2019-06-06 10:37:55 +08:00 committed by Péter Szilágyi
parent 726e4607f8
commit 647e1acb91
No known key found for this signature in database
GPG key ID: E9AE538CEDF8293D

View file

@ -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) {