message: fix: Return early for non-existent block
diff: @@ -63,6 +63,7 @@ impl<CS: ChainStore + 'static> ChainRpc for ChainRpcImpl<CS> {
  }
  // TODO: we need to build a proper index instead of scanning every time
  + // TODO: limit page size
  fn get_cells_by_lock_hash(
  &self,
  lock_hash: H256,
  @@ -78,7 +79,12 @@ impl<CS: ChainStore + 'static> ChainRpc for ChainRpcImpl<CS> {
  .parse::<BlockNumber>()
  .map_err(|_| Error::parse_error())?;
  for block_number in from..=to {
  - if let Some(block_hash) = self.shared.block_hash(block_number) {
  + let block_hash = self.shared.block_hash(block_number);
  + if block_hash.is_none() {
  + break;
  + }
  +
  + let block_hash = block_hash.unwrap();
  let block = self
  .shared
  .block(&block_hash)
  @@ -102,7 +108,6 @@ impl<CS: ChainStore + 'static> ChainRpc for ChainRpcImpl<CS> {
  }
  }
  }
  - }
  Ok(result)
  }
  