fix latest param handling in api v1

pull/3100/head
Dennis Won 5 years ago committed by Leo Chen
parent a0ae6802d2
commit d63893cdb9
  1. 4
      internal/hmyapi/apiv1/blockchain.go

@ -66,7 +66,9 @@ func (s *PublicBlockChainAPI) isBeaconShard() error {
} }
func (s *PublicBlockChainAPI) isBlockGreaterThanLatest(blockNum rpc.BlockNumber) 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 ErrRequestedBlockTooHigh
} }
return nil return nil

Loading…
Cancel
Save