def confirm_name_imported( client, name ):
    """
    See if a name has been imported.
    """
    
    name_info = client.lookup( name )
    if 'error' in name_info:
        log.info( "confirm '%s'...no" % name )
        return False 
    
    # must be a full record 
    name_info = name_info[0]
    
    if name_info is None:
        log.info( "confirm '%s'...no" % name )
        return False 
    
    if 'address' not in name_info:
        log.info( "confirm '%s'...no" % name )
        return False 
    
    if 'value_hash' not in name_info:
        log.info( "confirm '%s'...no" % name )
        return False 
    
    if name_info['value_hash'] is None:
        log.info( "confirm '%s'...no" % name )
        return False 
    
    log.info( "confirm '%s'...yes" % name )
    return True
Exemplo n.º 2
0
def confirm_name_imported( client, name ):
    """
    See if a name has been imported.
    """
    
    name_info = client.lookup( name )
    if 'error' in name_info:
        log.info( "confirm '%s'...no" % name )
        return False 
    
    # must be a full record 
    name_info = name_info[0]
    
    if name_info is None:
        log.info( "confirm '%s'...no" % name )
        return False 
    
    if 'address' not in name_info:
        log.info( "confirm '%s'...no" % name )
        return False 
    
    if 'value_hash' not in name_info:
        log.info( "confirm '%s'...no" % name )
        return False 
    
    if name_info['value_hash'] is None:
        log.info( "confirm '%s'...no" % name )
        return False 
    
    log.info( "confirm '%s'...yes" % name )
    return True
        try:
           fqn = str(fqn)
        except:
           log.debug("non-ascii name '%s'" % fqn)
           continue
          
        count = 0
        MAX_COUNT = len(keyring)
        already_exists = False
        while count < MAX_COUNT:
 
           pk_str = keyring[ key_rr % len(keyring) ]
           pub_str = pybitcoin.BitcoinPrivateKey( pk_str ).public_key().address()
           key_rr += 1
           
           existing_name = client.lookup( fqn )
            
           try:
                if existing_name[0] is not None:
                    log.debug("Name '%s' already imported: %s" % (fqn, existing_name))
                
                    confirmed_fd.write( "%s\n" % fqn )
                    confirmed_fd.flush()
                    confirmed_names.append( fqn )
                    already_exists = True
                    break
                    
           except Exception, e:
                log.exception(e)
                sys.exit(0)
           
Exemplo n.º 4
0
        try:
           fqn = str(fqn)
        except:
           log.debug("non-ascii name '%s'" % fqn)
           continue
          
        count = 0
        MAX_COUNT = len(keyring)
        already_exists = False
        while count < MAX_COUNT:
 
           pk_str = keyring[ key_rr % len(keyring) ]
           pub_str = pybitcoin.BitcoinPrivateKey( pk_str ).public_key().address()
           key_rr += 1
           
           existing_name = client.lookup( fqn )
            
           try:
                if existing_name[0] is not None:
                    log.debug("Name '%s' already imported: %s" % (fqn, existing_name))
                
                    confirmed_fd.write( "%s\n" % fqn )
                    confirmed_fd.flush()
                    confirmed_names.append( fqn )
                    already_exists = True
                    break
                    
           except Exception, e:
                log.exception(e)
                sys.exit(0)