ledbits.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:ClockBlocker 作者: pinheadmz 项目源码 文件源码
def withdraw():
    printMsg("Loading unspent coins...")

    # connect to node and get all unspent outputs
    try:
        list = rpc_connection.listunspent(0)
    except (socket.error, httplib.CannotSendRequest):
        printMsg("listunspent http error", COLOR_RED)
        time.sleep(2)
        return False

    # no coins
    if len(list) == 0:
        printMsg("No unspent outputs!", COLOR_RED)
        time.sleep(2)
        return False

    # calculate balances of each spendable key in wallet
    coins = {}
    for addr in list:
        if addr['address'] in coins:
            coins[addr['address']] += addr['amount']
        else:
            coins[addr['address']] = addr['amount']

    # send unspent coins list to the recursive paging menu function
    withdrawMenu(coins)


# display bitcoin address QR code for tipping
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号