eth_blockNumber should be equal to latest in eth_getBlockByNumber (#4421)

This commit is contained in:
Andrew Ashikhmin 2022-06-09 15:53:37 +02:00 committed by GitHub
parent f830401258
commit 36eacd23c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,14 +22,14 @@ func (api *APIImpl) BlockNumber(ctx context.Context) (hexutil.Uint64, error) {
return 0, err
}
defer tx.Rollback()
execution, err := stages.GetStageProgress(tx, stages.Finish)
blockNum, err := getLatestBlockNumber(tx)
if err != nil {
return 0, err
}
return hexutil.Uint64(execution), nil
return hexutil.Uint64(blockNum), nil
}
// Syncing implements eth_syncing. Returns a data object detaling the status of the sync process or false if not syncing.
// Syncing implements eth_syncing. Returns a data object detailing the status of the sync process or false if not syncing.
func (api *APIImpl) Syncing(ctx context.Context) (interface{}, error) {
tx, err := api.db.BeginRo(ctx)
if err != nil {