Browse Source

Merge #488: Add loop in the CLI for freezing UTXOs

66823aa Add loop in the CLI for freezing UTXOs (chris-belcher)

Tree-SHA512: 0a75dfaa680c52aa8f14eb7ee810eae27870637cf637cd570bf930ee23f64c3f6a38426e4f6962d3cd6d3beb2c8438fd7b2e76c0c157ff1bfe5153a442e68cca
master
chris-belcher 6 years ago
parent
commit
bf3b38c40f
No known key found for this signature in database
GPG Key ID: EF734EA677F31129
  1. 4
      jmclient/jmclient/wallet_utils.py

4
jmclient/jmclient/wallet_utils.py

@ -981,6 +981,7 @@ def display_utxos_for_disable_choice_default(utxos_enabled, utxos_disabled):
start += 1
yield txid, idx
jmprint("List of UTXOs:")
ulist = list(output_utxos(utxos_disabled, 'FROZEN'))
disabled_max = len(ulist) - 1
ulist.extend(output_utxos(utxos_enabled, 'NOT FROZEN', start=len(ulist)))
@ -1033,6 +1034,7 @@ def wallet_freezeutxo(wallet, md, display_callback=None, info_callback=None):
if md is None:
info_callback("Specify the mixdepth with the -m flag", "error")
return "Failed"
while True:
utxos_enabled, utxos_disabled = get_utxos_enabled_disabled(wallet, md)
if utxos_disabled == {} and utxos_enabled == {}:
info_callback("The mixdepth: " + str(md) + \
@ -1040,7 +1042,7 @@ def wallet_freezeutxo(wallet, md, display_callback=None, info_callback=None):
return "Failed"
display_ret = display_callback(utxos_enabled, utxos_disabled)
if display_ret is None:
return "OK"
break
(txid, index), disable = display_ret
wallet.disable_utxo(txid, index, disable)
if disable:

Loading…
Cancel
Save