Skip to content

getBlockByHash and getBlockByNumber will return a block number if block is pending #1572

Closed
@kclowes

Description

@kclowes

What was wrong?

As of geth 1.9.11, eth_getBlockByHash and eth_getBlockByNumber will be returning a block number if the block is pending, instead of null. Older versions of geth were returning a number, but as of 1.9.7, geth returns null if the block is pending.

https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblockbyhash

Context:
ethereum/go-ethereum#20587

How can it be fixed?

Check to make sure that web3 can handle either a null response or a block number. This probably means adding some testing. Will also need to check parity's responses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions