Example #1
0
def import_user(username):

    for transfer_user in transfer.find():

        user_id = transfer_user['user_id']
        new_user = users.find_one({"_id": user_id})

        if new_user is None:
            continue

        if new_user['username'] == username:
            old_user = old_users.find_one({'username': new_user['username']})
            print username
        else:
            continue

        old_nmc_address = old_user['namecoin_address']

        wif_pk = bip38_decrypt(str(transfer_user['encrypted_private_key']),
                               FRONTEND_SECRET)

        keypair = NamecoinKeypair.from_private_key(wif_pk)

        if old_nmc_address == keypair.address():
            print old_nmc_address
Example #2
0
def import_update(userobj):

    user_id = userobj['user_id']
    update_user = users.find_one({"_id": user_id})

    if update_user is None:
        return

    nmc_address = update_user['namecoin_address']

    wif_pk = bip38_decrypt(str(userobj['encrypted_private_key']), FRONTEND_SECRET)

    keypair = NamecoinKeypair.from_private_key(wif_pk)

    namecoind = NamecoindClient(NAMECOIND_UPDATE_SERVER, NAMECOIND_PORT, NAMECOIND_USER,
                                NAMECOIND_PASSWD, NAMECOIND_USE_HTTPS,
                                NAMECOIND_WALLET_PASSPHRASE)

    if nmc_address == keypair.address():
        print update_user['username']
        print nmc_address
        print namecoind.importprivkey(keypair.wif_pk())
Example #3
0
def import_update(userobj):

    user_id = userobj['user_id']
    update_user = users.find_one({"_id": user_id})

    if update_user is None:
        return

    nmc_address = update_user['namecoin_address']

    wif_pk = bip38_decrypt(str(userobj['encrypted_private_key']), FRONTEND_SECRET)

    keypair = NamecoinKeypair.from_private_key(wif_pk)

    namecoind = NamecoindClient(NAMECOIND_UPDATE_SERVER, NAMECOIND_PORT, NAMECOIND_USER,
                                NAMECOIND_PASSWD, NAMECOIND_USE_HTTPS,
                                NAMECOIND_WALLET_PASSPHRASE)

    if nmc_address == keypair.address():
        print update_user['username']
        print nmc_address
        print namecoind.importprivkey(keypair.wif_pk())
Example #4
0
def import_user(username):

    for transfer_user in transfer.find():

        user_id = transfer_user['user_id']
        new_user = users.find_one({"_id": user_id})

        if new_user is None:
            continue

        if new_user['username'] == username:
            old_user = old_users.find_one({'username': new_user['username']})
            print username
        else:
            continue

        old_nmc_address = old_user['namecoin_address']

        wif_pk = bip38_decrypt(str(transfer_user['encrypted_private_key']), FRONTEND_SECRET)

        keypair = NamecoinKeypair.from_private_key(wif_pk)

        if old_nmc_address == keypair.address():
            print old_nmc_address