def _txins_data(self):
        """
        :return: a couple (segwit, txins) where `segwit` is a boolean
        telling whether the transaction has a segwit format
        """
        ntxins = self.parse_varint()
        if ntxins == 0:
            self.segwit = True
            flag = next(self)
            if flag != 1:
                raise ValueError('Wrong flag in SegWit transaction: {}'.format(flag))
            ntxins = self.parse_varint()
        else:
            self.segwit = False
        self.txins = ntxins
        return self.segwit, [self._txin_data() for _ in range(ntxins)]