From bc90f517d110efd8babf38f7ef72ce6c9beda112 Mon Sep 17 00:00:00 2001 From: f321x Date: Tue, 4 Mar 2025 14:28:17 +0100 Subject: [PATCH] check if channel type before checking if zeroconf option --- electrum/lnpeer.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py index 3254cb6b9..95dc1c786 100644 --- a/electrum/lnpeer.py +++ b/electrum/lnpeer.py @@ -1041,9 +1041,12 @@ class Peer(Logger, EventListener): if not channel_type.complies_with_features(self.features): raise Exception("sender has sent a channel type we don't support") - is_zeroconf = channel_type & channel_type.OPTION_ZEROCONF - if is_zeroconf and not self.network.config.ZEROCONF_TRUSTED_NODE.startswith(self.pubkey.hex()): - raise Exception(f"not accepting zeroconf from node {self.pubkey}") + if self.is_channel_type(): + is_zeroconf = channel_type & channel_type.OPTION_ZEROCONF + if is_zeroconf and not self.network.config.ZEROCONF_TRUSTED_NODE.startswith(self.pubkey.hex()): + raise Exception(f"not accepting zeroconf from node {self.pubkey}") + else: + is_zeroconf = False if self.lnworker.has_recoverable_channels() and not is_zeroconf: # FIXME: we might want to keep the connection open