code: def namedb_get_all_importing_namespace_hashes( self, current_block ):
      
  
      query = "SELECT preorder_hash FROM namespaces WHERE (op = ? AND reveal_block < ?) OR (op = ? AND block_number < ?);"
      args = (NAMESPACE_REVEAL, current_block + NAMESPACE_REVEAL_EXPIRE, NAMESPACE_PREORDER, current_block + NAMESPACE_PREORDER_EXPIRE )
  
      namespace_rows = namedb_query_execute( cur, query, args )
      ret = []
      for namespace_row in namespace_rows:
          ret.append( namespace_row['preorder_hash'] )
  
      return ret
docs: Get the list of all non-expired preordered and revealed namespace hashes.