code: def get_name_from_name_consensus_hash( self, name_consensus_hash, sender_script_pubkey, block_id ):
          
          import virtualchain_hooks
  
          cur = self.db.cursor()
          names = namedb_get_names_by_sender( cur, sender_script_pubkey, self.lastblock )
          
          if names is None:
              log.error("Sender script '%s' owns no names" % sender_script_pubkey )
              return (None, None)
  
          possible_consensus_hashes = []
          for i in range( block_id - virtualchain_hooks.get_valid_transaction_window(), block_id+1 ):
              consensus_hash = self.get_consensus_at( i )
              if consensus_hash is not None and consensus_hash not in possible_consensus_hashes:
                  possible_consensus_hashes.append( str(consensus_hash) )
      
          for name in names:
              for consensus_hash in possible_consensus_hashes:
                  # what would have been the name/consensus_hash?
                  test_name_consensus_hash = hash256_trunc128( str(name) + consensus_hash )
                  if test_name_consensus_hash == name_consensus_hash:
                      # found!
                      return name, consensus_hash
  
          return None, None
docs: Find the name.ns_id from hash( name.ns_id, consensus_hash ), given the sender and
          block_id, and assuming that name.ns_id is already registered.
  
          There are only a small number of values this hash can take, so test all of them to
          see if the hash matches one of them.
  
          This is used for name updates--we need to ensure that updates have timely consensus
          hashes, and are on the majority blockchian fork.
  
          Return (fully-qualified name, consensus hash) on success
          Return (None, None) if not found.