1
0

check if channel type before checking if zeroconf option

This commit is contained in:
f321x
2025-03-04 14:28:17 +01:00
parent 6a0e537b9c
commit bc90f517d1

View File

@@ -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