internal/ethapi: revert change from #20460, return number on pending block

This commit is contained in:
Martin Holst Swende 2020-02-03 14:21:06 +01:00
parent 15d09038a6
commit 699ad14d5e
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -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
} }
} }