def check_sighash(self, tx: 'PartialTransaction') -> TxSighashDanger:
        """Checks the Sighash for my inputs and considers if the tx is safe to sign."""
        assert isinstance(tx, PartialTransaction)
        rl = TxSighashRiskLevel
        hintmap = {
            0:                    (rl.SAFE,           None),
            Sighash.NONE:         (rl.INSANE_SIGHASH, _('Input {} is marked SIGHASH_NONE.')),
            Sighash.SINGLE:       (rl.WEIRD_SIGHASH,  _('Input {} is marked SIGHASH_SINGLE.')),
            Sighash.ALL:          (rl.SAFE,           None),
            Sighash.ANYONECANPAY: (rl.WEIRD_SIGHASH,  _('Input {} is marked SIGHASH_ANYONECANPAY.')),
        }
        sighash_danger = TxSighashDanger()
        for txin_idx, txin in enumerate(tx.inputs()):
            if txin.sighash in (None, Sighash.ALL):
                continue  # None will get converted to Sighash.ALL, so these values are safe
            # found interesting sighash flag
            addr = self.adb.get_txin_address(txin)
            if self.is_mine(addr):
                sh_base = txin.sighash & (Sighash.ANYONECANPAY ^ 0xff)
                sh_acp = txin.sighash & Sighash.ANYONECANPAY
                for sh in [sh_base, sh_acp]:
                    if msg := hintmap[sh][1]:
                        risk_level = hintmap[sh][0]
                        header = _('Fatal') if TxSighashDanger(risk_level=risk_level).needs_reject() else _('Warning')
                        shd = TxSighashDanger(
                            risk_level=risk_level,
                            short_message=_('Danger! This transaction uses non-default sighash flags!'),
                            messages=[f"{header}: {msg.format(txin_idx)}"],
                        )
                        sighash_danger = sighash_danger.combine(shd)
        if sighash_danger.needs_reject():  # no point for further tests
            return sighash_danger
        # if we show any fee to the user, check now how reliable that is:
        if self.get_wallet_delta(tx).fee is not None:
            shd = self._check_risk_of_burning_coins_as_fees(tx)
            sighash_danger = sighash_danger.combine(shd)
        return sighash_danger
Checks the Sighash for my inputs and considers if the tx is safe to sign.
electrum/wallet.py