def dump_signatures(tx, tx_in, tx_out, idx, netcode, address_prefix, traceback_f, disassembly_level):
    signatures = []
    for opcode in opcode_list(tx_in.script):
        if (not opcode.startswith('OP_')):
            try:
                signatures.append(parse_signature_blob(h2b(opcode[1:(- 1)])))
            except UnexpectedDER:
                pass
    if signatures:
        sig_types_identical = (tuple(zip(*signatures))[1].count(signatures[0][1]) == len(signatures))
        i = (1 if (len(signatures) > 1) else '')
        for (sig_pair, sig_type) in signatures:
            print('      r{0}: {1:#x}\n      s{0}: {2:#x}'.format(i, *sig_pair))
            if ((not sig_types_identical) and tx_out):
                print('      z{}: {:#x} {}'.format(i, tx.signature_hash(tx_out.script, idx, sig_type), sighash_type_to_string(sig_type)))
            if i:
                i += 1
        if (sig_types_identical and tx_out):
            print('      z:{} {:#x} {}'.format((' ' if i else ''), tx.signature_hash(tx_out.script, idx, sig_type), sighash_type_to_string(sig_type)))
def dump_signatures(tx, tx_in, tx_out, idx, netcode, address_prefix, traceback_f, disassembly_level):
    signatures = []
    for opcode in opcode_list(tx_in.script):
        if (not opcode.startswith('OP_')):
            try:
                signatures.append(parse_signature_blob(h2b(opcode[1:(- 1)])))
            except UnexpectedDER:
                pass
    if signatures:
        sig_types_identical = (tuple(zip(*signatures))[1].count(signatures[0][1]) == len(signatures))
        i = (1 if (len(signatures) > 1) else )
        for (sig_pair, sig_type) in signatures:
            print('      r{0}: {1:#x}\n      s{0}: {2:#x}'.format(i, *sig_pair))
            if ((not sig_types_identical) and tx_out):
                print('      z{}: {:#x} {}'.format(i, tx.signature_hash(tx_out.script, idx, sig_type), sighash_type_to_string(sig_type)))
            if i:
                i += 1
        if (sig_types_identical and tx_out):
            print('      z:{} {:#x} {}'.format((' ' if i else ), tx.signature_hash(tx_out.script, idx, sig_type), sighash_type_to_string(sig_type)))