From e5ec17244295636c174eb8f82e8f23dfa675c2c8 Mon Sep 17 00:00:00 2001 From: Kristaps Kaupe Date: Mon, 11 May 2020 19:05:53 +0300 Subject: [PATCH] Output frozen UTXO's on showutxos too, add "frozen" state to output --- jmclient/jmclient/wallet_utils.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/jmclient/jmclient/wallet_utils.py b/jmclient/jmclient/wallet_utils.py index ee7b336..7278682 100644 --- a/jmclient/jmclient/wallet_utils.py +++ b/jmclient/jmclient/wallet_utils.py @@ -362,23 +362,29 @@ def get_imported_privkey_branch(wallet_service, m, showprivkey): return WalletViewBranch("m/0", m, -1, branchentries=entries) return None -def wallet_showutxos(wallet, showprivkey): +def wallet_showutxos(wallet_service, showprivkey): unsp = {} max_tries = jm_single().config.getint("POLICY", "taker_utxo_retries") - utxos = wallet.get_utxos_by_mixdepth(includeconfs=True) + utxos = wallet_service.get_utxos_by_mixdepth(include_disabled=True, + includeconfs=True) for md in utxos: + (enabled, disabled) = get_utxos_enabled_disabled(wallet_service, md) + utxo_d = [] + for k, v in disabled.items(): + utxo_d.append(k) for u, av in utxos[md].items(): success, us = utxo_to_utxostr(u) assert success - key = wallet.get_key_from_addr(av['address']) + key = wallet_service.get_key_from_addr(av['address']) tries = podle.get_podle_tries(u, key, max_tries) tries_remaining = max(0, max_tries - tries) unsp[us] = {'address': av['address'], 'value': av['value'], 'tries': tries, 'tries_remaining': tries_remaining, 'external': False, - 'confirmations': av['confs']} + 'confirmations': av['confs'], + 'frozen': True if u in utxo_d else False} if showprivkey: - unsp[us]['privkey'] = wallet.get_wif_path(av['path']) + unsp[us]['privkey'] = wallet_service.get_wif_path(av['path']) used_commitments, external_commitments = podle.get_podle_commitments() for u, ec in external_commitments.items():