diff --git a/electrum/lnutil.py b/electrum/lnutil.py index 448f34bfe..826e661b5 100644 --- a/electrum/lnutil.py +++ b/electrum/lnutil.py @@ -1552,6 +1552,7 @@ LN_FEATURES_IMPLEMENTED = ( | LnFeatures.OPTION_SHUTDOWN_ANYSEGWIT_OPT | LnFeatures.OPTION_SHUTDOWN_ANYSEGWIT_REQ | LnFeatures.OPTION_CHANNEL_TYPE_OPT | LnFeatures.OPTION_CHANNEL_TYPE_REQ | LnFeatures.OPTION_SCID_ALIAS_OPT | LnFeatures.OPTION_SCID_ALIAS_REQ + | LnFeatures.OPTION_ANCHOR_OUTPUTS_OPT | LnFeatures.OPTION_ANCHOR_OUTPUTS_REQ ) diff --git a/electrum/lnworker.py b/electrum/lnworker.py index edd2b7a43..71461c719 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -833,6 +833,8 @@ class LNWallet(LNWorker): self.payment_secret_key = generate_keypair(BIP32Node.from_xkey(xprv), LnKeyFamily.PAYMENT_SECRET_KEY).privkey Logger.__init__(self) features = LNWALLET_FEATURES + if self.config.ENABLE_ANCHOR_CHANNELS: + features |= LnFeatures.OPTION_ANCHOR_OUTPUTS_OPT if self.config.ACCEPT_ZEROCONF_CHANNELS: features |= LnFeatures.OPTION_ZEROCONF_OPT LNWorker.__init__(self, self.node_keypair, features, config=self.config) diff --git a/electrum/simple_config.py b/electrum/simple_config.py index a17febcdf..eefa8e72f 100644 --- a/electrum/simple_config.py +++ b/electrum/simple_config.py @@ -1211,6 +1211,8 @@ Warning: setting this to too low will result in lots of payment failures."""), ]), ) + # anchor outputs channels + ENABLE_ANCHOR_CHANNELS = ConfigVar('enable_anchor_channels', default=False, type_=bool) # zeroconf channels ACCEPT_ZEROCONF_CHANNELS = ConfigVar('accept_zeroconf_channels', default=False, type_=bool) ZEROCONF_TRUSTED_NODE = ConfigVar('zeroconf_trusted_node', default='', type_=str) diff --git a/tests/test_lnpeer.py b/tests/test_lnpeer.py index 06db6ba8e..be15c8749 100644 --- a/tests/test_lnpeer.py +++ b/tests/test_lnpeer.py @@ -177,6 +177,7 @@ class MockLNWallet(Logger, EventListener, NetworkRetryManager[LNPeerAddr]): self.features |= LnFeatures.OPTION_CHANNEL_TYPE_OPT self.features |= LnFeatures.OPTION_SCID_ALIAS_OPT self.features |= LnFeatures.OPTION_STATIC_REMOTEKEY_OPT + self.config.ENABLE_ANCHOR_CHANNELS = TEST_ANCHOR_CHANNELS self.pending_payments = defaultdict(asyncio.Future) for chan in chans: chan.lnworker = self