Unverified Commit 4a231cd9 authored by Martin Holst Swende's avatar Martin Holst Swende Committed by GitHub

internal/ethapi: return non-null "number" for pending block (#20616)

Fixes: #20587, ethereum/web3.py#1572
parent 976a0f55
...@@ -642,7 +642,7 @@ func (s *PublicBlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.B ...@@ -642,7 +642,7 @@ func (s *PublicBlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.B
response, err := s.rpcMarshalBlock(block, true, fullTx) response, err := s.rpcMarshalBlock(block, true, fullTx)
if err == nil && number == rpc.PendingBlockNumber { if err == nil && number == rpc.PendingBlockNumber {
// Pending blocks need to nil out a few fields // Pending blocks need to nil out a few fields
for _, field := range []string{"hash", "nonce", "miner", "number"} { for _, field := range []string{"hash", "nonce", "miner"} {
response[field] = nil response[field] = nil
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment