Пример #1
0
    conn = sqlite3.connect(database)
    # create table if needed
    check_create_table(conn)

    # init network
    config = SimpleConfig({"wallet_path": wallet_path})
    network = Network(config)
    network.start(wait=True)

    # create watching_only wallet
    storage = WalletStorage(config)
    wallet = Wallet(storage)
    if not storage.file_exists:
        wallet.seed = ""
        wallet.create_watching_only_wallet(master_public_key, master_chain)

    wallet.synchronize = lambda: None  # prevent address creation by the wallet
    wallet.start_threads(network)
    network.register_callback("updated", on_wallet_update)

    out_queue = Queue.Queue()
    thread.start_new_thread(server_thread, (conn,))

    while not stopping:
        cur = conn.cursor()

        # read pending requests from table
        cur.execute("SELECT address, amount, confirmations FROM electrum_payments WHERE paid IS NULL;")
        data = cur.fetchall()
Пример #2
0
    conn = sqlite3.connect(database)
    # create table if needed
    check_create_table(conn)

    # init network
    config = SimpleConfig({'wallet_path': wallet_path})
    network = Network(config)
    network.start(wait=True)

    # create watching_only wallet
    storage = WalletStorage(config)
    wallet = Wallet(storage)
    if not storage.file_exists:
        wallet.seed = ''
        wallet.create_watching_only_wallet(master_public_key, master_chain)

    wallet.synchronize = lambda: None  # prevent address creation by the wallet
    wallet.start_threads(network)
    network.register_callback('updated', on_wallet_update)

    out_queue = Queue.Queue()
    thread.start_new_thread(server_thread, (conn, ))

    while not stopping:
        cur = conn.cursor()

        # read pending requests from table
        cur.execute(
            "SELECT address, amount, confirmations FROM electrum_payments WHERE paid IS NULL;"
        )