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
评论列表
文章目录