LNWallet: set trampoline invoice feature independently

Make the trampoline signaling in bolt11 invoices dependent upon all
unfrozen channels being with trampoline peers instead of the trampoline
config.
Stops automatically freezing non-trampoline channels for receiving if
trampoline is enabled.

One effect of this change is that now we don't signal trampoline support
anymore in the invoice even if trampoline is enabled, if one of the
channels is with a non trampoline peer.
This commit is contained in:
f321x
2026-03-24 11:41:46 +01:00
parent 0265c70766
commit 609a274661
2 changed files with 2 additions and 3 deletions
-2
View File
@@ -1101,8 +1101,6 @@ class Channel(AbstractChannel):
util.trigger_callback('channel', self.lnworker.wallet, self)
def is_frozen_for_receiving(self) -> bool:
if self.lnworker.uses_trampoline() and not self.lnworker.is_trampoline_peer(self.node_id):
return True
return self.storage.get('frozen_for_receiving', False)
def set_frozen_for_receiving(self, b: bool) -> None:
+2 -1
View File
@@ -2545,7 +2545,8 @@ class LNWallet(Logger):
def _get_invoice_features(self, amount_msat: Optional[int]) -> LnFeatures:
invoice_features = self.features.for_invoice()
if not self.uses_trampoline():
if not all((not c.is_open() or c.is_frozen_for_receiving()) or self.is_trampoline_peer(c.node_id) \
for c in self.channels.values()):
invoice_features &= ~ LnFeatures.OPTION_TRAMPOLINE_ROUTING_OPT_ELECTRUM
needs_jit: bool = self.receive_requires_jit_channel(amount_msat)
if needs_jit: