fix latest param handling in api v1

pull/3084/head
Dennis Won 5 years ago committed by Leo Chen
parent 4e3d7c0b92
commit 0b2bd308b8
  1. 4
      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

Loading…
Cancel
Save