def dump_inputs(tx, netcode, verbose_signature, address_prefix, traceback_f, disassembly_level):

    def signature_for_hash_type_f(hash_type, script):
        return tx.signature_hash(script, idx, hash_type)
    for (idx, tx_in) in enumerate(tx.txs_in):
        if tx.is_coinbase():
            print(('%4d: COINBASE  %12.5f mBTC' % (idx, satoshi_to_mbtc(tx.total_in()))))
            continue
        suffix = ''
        if tx.missing_unspent(idx):
            tx_out = None
            address = tx_in.bitcoin_address(address_prefix=address_prefix)
        else:
            tx_out = tx.unspents[idx]
            sig_result = (' sig ok' if tx.is_signature_ok(idx, traceback_f=traceback_f) else ' BAD SIG')
            suffix = (' %12.5f mBTC %s' % (satoshi_to_mbtc(tx_out.coin_value), sig_result))
            address = tx_out.bitcoin_address(netcode=netcode)
        t = ('%4d: %34s from %s:%-4d%s' % (idx, address, b2h_rev(tx_in.previous_hash), tx_in.previous_index, suffix))
        print(t.rstrip())
        if (disassembly_level > 0):
            dump_disassembly(tx_in, tx_out, tx.lock_time, signature_for_hash_type_f)
        if verbose_signature:
            dump_signatures(tx, tx_in, tx_out, idx, netcode, address_prefix, traceback_f, disassembly_level)
def dump_inputs(tx, netcode, verbose_signature, address_prefix, traceback_f, disassembly_level):

    def signature_for_hash_type_f(hash_type, script):
        return tx.signature_hash(script, idx, hash_type)
    for (idx, tx_in) in enumerate(tx.txs_in):
        if tx.is_coinbase():
            print(('%4d: COINBASE  %12.5f mBTC' % (idx, satoshi_to_mbtc(tx.total_in()))))
            continue
        suffix = 
        if tx.missing_unspent(idx):
            tx_out = None
            address = tx_in.bitcoin_address(address_prefix=address_prefix)
        else:
            tx_out = tx.unspents[idx]
            sig_result = (' sig ok' if tx.is_signature_ok(idx, traceback_f=traceback_f) else ' BAD SIG')
            suffix = (' %12.5f mBTC %s' % (satoshi_to_mbtc(tx_out.coin_value), sig_result))
            address = tx_out.bitcoin_address(netcode=netcode)
        t = ('%4d: %34s from %s:%-4d%s' % (idx, address, b2h_rev(tx_in.previous_hash), tx_in.previous_index, suffix))
        print(t.rstrip())
        if (disassembly_level > 0):
            dump_disassembly(tx_in, tx_out, tx.lock_time, signature_for_hash_type_f)
        if verbose_signature:
            dump_signatures(tx, tx_in, tx_out, idx, netcode, address_prefix, traceback_f, disassembly_level)