From 36eacd23c02c76beead52676f0a606e3ab8b14aa Mon Sep 17 00:00:00 2001 From: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:53:37 +0200 Subject: [PATCH] eth_blockNumber should be equal to latest in eth_getBlockByNumber (#4421) --- cmd/rpcdaemon/commands/eth_system.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/rpcdaemon/commands/eth_system.go b/cmd/rpcdaemon/commands/eth_system.go index e9969f5d0..1095cdd82 100644 --- a/cmd/rpcdaemon/commands/eth_system.go +++ b/cmd/rpcdaemon/commands/eth_system.go @@ -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 {