diff --git a/electrum/invoices.py b/electrum/invoices.py index c7879fc7e..d921a323c 100644 --- a/electrum/invoices.py +++ b/electrum/invoices.py @@ -149,6 +149,10 @@ class LNInvoice(Invoice): __lnaddr = None + @invoice.validator + def check(self, attribute, value): + lndecode(value) # this checks the str can be decoded + @property def _lnaddr(self) -> LnAddr: if self.__lnaddr is None: diff --git a/electrum/lnutil.py b/electrum/lnutil.py index 67af0cf6b..24f3d341e 100644 --- a/electrum/lnutil.py +++ b/electrum/lnutil.py @@ -1036,7 +1036,8 @@ def validate_features(features: int) -> None: if (1 << fbit) & LN_FEATURES_IMPLEMENTED == 0 and fbit % 2 == 0: raise UnknownEvenFeatureBits(fbit) if not features.validate_transitive_dependecies(): - raise IncompatibleOrInsaneFeatures("not all transitive dependencies are set") + raise IncompatibleOrInsaneFeatures(f"not all transitive dependencies are set. " + f"features={features}") def derive_payment_secret_from_payment_preimage(payment_preimage: bytes) -> bytes: