def annotate_scripts(self, tx, tx_in_idx):
        "return list of pre_annotations, pc, opcode, instruction, post_annotations"
        # input_annotations_f, output_annotations_f = annotation_f_for_scripts(tx, tx_in_idx)

        data_annotations = collections.defaultdict(list)

        def traceback_f(opcode, data, pc, vmc):
            if opcode in (self.OP_CHECKSIG, self.OP_CHECKSIGVERIFY):
                self.annotate_checksig(vmc, data_annotations)
            if opcode in (self.OP_CHECKMULTISIG, self.OP_CHECKMULTISIGVERIFY):
                self.annotate_checkmultisig(vmc, data_annotations)
            return

        try:
            tx.check_solution(tx_in_idx, traceback_f=traceback_f)
        except ScriptError:
            pass

        r = []

        def traceback_f(opcode, data, pc, vmc):
            a0 = []
            if vmc.pc == 0:
                if vmc.is_solution_script:
                    a0.append("--- SIGNATURE SCRIPT START")
                else:
                    a0.append("--- PUBLIC KEY SCRIPT START")
            r.append((a0, vmc.pc, opcode, self.instruction_for_opcode(opcode, data), data_annotations[data]))

        try:
            tx.check_solution(tx_in_idx, traceback_f=traceback_f)
        except ScriptError:
            pass

        # the script may have ended early, so let's just double-check
        try:
            for idx, (opcode, data, pc, new_pc) in enumerate(itertools.chain(
                self._script_tools.get_opcodes(tx.unspents[tx_in_idx].script),
                    self._script_tools.get_opcodes(tx.txs_in[tx_in_idx].script))):
                if idx >= len(r):
                    r.append(([], pc, opcode, self.instruction_for_opcode(opcode, data), []))
        except IndexError:
            pass

        return r
return list of pre_annotations, pc, opcode, instruction, post_annotations