Esempio n. 1
0
                                              BitcoinCoreInterface):
        print('showing history only available when using the Bitcoin Core ' +
              'blockchain interface')
        sys.exit(0)
    if method not in noscan_methods:
        # if nothing was configured, we override bitcoind's options so that
        # unconfirmed balance is included in the wallet display by default
        if 'listunspent_args' not in jm_single().config.options('POLICY'):
            jm_single().config.set('POLICY', 'listunspent_args', '[0]')

        sync_wallet(wallet, fast=options.fastsync)

if method == 'showutxos':
    unsp = {}
    max_tries = jm_single().config.getint("POLICY", "taker_utxo_retries")
    for mixdepth, utxos in wallet.get_utxos_by_mixdepth().iteritems():
        for u, av in utxos.iteritems():
            key = wallet.get_key_from_addr(av['address'])
            tries = btc.podle.get_podle_tries(u, key, max_tries)
            tries_remaining = max(0, max_tries - tries)

            unsp[u] = {
                'mixdepth': mixdepth,
                'address': av['address'],
                'value': av['value'],
                'tries': tries,
                'tries_remaining': tries_remaining,
                'external': False
            }

            if options.showprivkey:
Esempio n. 2
0
            BitcoinCoreInterface):
        print('showing history only available when using the Bitcoin Core ' +
            'blockchain interface')
        sys.exit(0)
    if method not in noscan_methods:
        # if nothing was configured, we override bitcoind's options so that
        # unconfirmed balance is included in the wallet display by default
        if 'listunspent_args' not in jm_single().config.options('POLICY'):
            jm_single().config.set('POLICY','listunspent_args', '[0]')

        sync_wallet(wallet, fast=options.fastsync)

if method == 'showutxos':
    unsp = {}
    max_tries = jm_single().config.getint("POLICY", "taker_utxo_retries")
    for mixdepth, utxos in wallet.get_utxos_by_mixdepth().iteritems():
        for u, av in utxos.iteritems():
            key = wallet.get_key_from_addr(av['address'])
            tries = btc.podle.get_podle_tries(u, key, max_tries)
            tries_remaining = max(0, max_tries - tries);

            unsp[u] = {'mixdepth': mixdepth, 'address': av['address'], 'value': av['value'], 'tries': tries, 'tries_remaining': tries_remaining, 'external': False}

            if options.showprivkey:
                wifkey = btc.wif_compressed_privkey(key, vbyte=get_p2pk_vbyte())
                unsp[u]['privkey'] = wifkey

    used_commitments, external_commitments = btc.podle.get_podle_commitments()
    for u, ec in external_commitments.iteritems():
        tries = btc.podle.get_podle_tries(utxo=u, max_tries=max_tries, external=True)
        tries_remaining = max(0, max_tries - tries);