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

Fixes: #20587, ethereum/web3.py#1572
This commit is contained in:
Martin Holst Swende 2020-02-07 10:44:32 +01:00 committed by GitHub
parent 976a0f5558
commit 4a231cd951
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -642,7 +642,7 @@ func (s *PublicBlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.B
response, err := s.rpcMarshalBlock(block, true, fullTx)
if err == nil && number == rpc.PendingBlockNumber {
// 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
}
}