From d63893cdb9b8b4094d880ab5e757f10d8d1d7744 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 a8129748d..1a68eb7a4 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