This commit is contained in:
Thomas Jay Rush 2020-09-12 01:33:07 -04:00 committed by GitHub
parent 0f24a01677
commit 752793264b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,8 +23,13 @@ func GetBlockNumber(blockNrOrHash rpc.BlockNumberOrHash, dbReader rawdb.Database
if err != nil {
return 0, common.Hash{}, fmt.Errorf("getting latest block number: %v", err)
}
} else if number == rpc.PendingBlockNumber || number == rpc.EarliestBlockNumber {
return 0, common.Hash{}, fmt.Errorf("pending and earliest blocks are not supported")
} else if number == rpc.EarliestBlockNumber {
blockNumber = 0
} else if number == rpc.PendingBlockNumber {
return 0, common.Hash{}, fmt.Errorf("pending blocks are not supported")
} else {
blockNumber = uint64(number.Int64())
}