From 0b2bd308b8f6449ad514c42abee0da195735dd0f Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Fri, 22 May 2020 03:53:43 -0700 Subject: [PATCH] fix latest param handling in api v1 --- internal/hmyapi/apiv1/blockchain.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/hmyapi/apiv1/blockchain.go b/internal/hmyapi/apiv1/blockchain.go index e9d6a23f4..41b327bbd 100644 --- a/internal/hmyapi/apiv1/blockchain.go +++ b/internal/hmyapi/apiv1/blockchain.go @@ -66,7 +66,9 @@ func (s *PublicBlockChainAPI) isBeaconShard() error { } func (s *PublicBlockChainAPI) isBlockGreaterThanLatest(blockNum rpc.BlockNumber) error { - if uint64(blockNum) > s.b.CurrentBlock().NumberU64() { + if blockNum != rpc.PendingBlockNumber && + blockNum != rpc.LatestBlockNumber && + uint64(blockNum) > s.b.CurrentBlock().NumberU64() { return ErrRequestedBlockTooHigh } return nil