lnutil: rm remnants of old unsupported original ANCHOR_OUTPUTS option
What changed, and why it matters
This commit removes leftover code for an obsolete and never-supported Lightning Network feature called 'anchor outputs.' It is a cleanup change with no apparent security relevance.
No action needed; this is a benign code cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes the old OPTION_ANCHOR_OUTPUTS feature bits and channel type from electrum/lnutil.py. These constants were not actually used by Electrum, which supports the newer ‘anchors zero fee HTLC’ option instead. The change only removes dead code and does not alter any active protocol behavior.
Changed components
electrum/lnutil.pyInspect captured patch +0 / −8
diff --git a/electrum/lnutil.py b/electrum/lnutil.py
index e938cf3..01789ed 100644
--- a/electrum/lnutil.py
+++ b/electrum/lnutil.py
@@ -1469,12 +1469,6 @@ class LnFeatures(IntFlag):
_ln_feature_contexts[OPTION_SUPPORT_LARGE_CHANNEL_OPT] = (LNFC.INIT | LNFC.NODE_ANN)
_ln_feature_contexts[OPTION_SUPPORT_LARGE_CHANNEL_REQ] = (LNFC.INIT | LNFC.NODE_ANN)
- OPTION_ANCHOR_OUTPUTS_REQ = 1 << 20
- OPTION_ANCHOR_OUTPUTS_OPT = 1 << 21
- _ln_feature_direct_dependencies[OPTION_ANCHOR_OUTPUTS_OPT] = {OPTION_STATIC_REMOTEKEY_OPT}
- _ln_feature_contexts[OPTION_ANCHOR_OUTPUTS_REQ] = (LNFC.INIT | LNFC.NODE_ANN)
- _ln_feature_contexts[OPTION_ANCHOR_OUTPUTS_OPT] = (LNFC.INIT | LNFC.NODE_ANN)
-
OPTION_ANCHORS_ZERO_FEE_HTLC_REQ = 1 << 22
OPTION_ANCHORS_ZERO_FEE_HTLC_OPT = 1 << 23
_ln_feature_direct_dependencies[OPTION_ANCHORS_ZERO_FEE_HTLC_OPT] = {OPTION_STATIC_REMOTEKEY_OPT}
@@ -1623,7 +1617,6 @@ class LnFeatures(IntFlag):
class ChannelType(IntFlag):
OPTION_LEGACY_CHANNEL = 0
OPTION_STATIC_REMOTEKEY = 1 << 12
- OPTION_ANCHOR_OUTPUTS = 1 << 20
OPTION_ANCHORS_ZERO_FEE_HTLC_TX = 1 << 22
OPTION_SCID_ALIAS = 1 << 46
OPTION_ZEROCONF = 1 << 50
@@ -1647,7 +1640,6 @@ class ChannelType(IntFlag):
basic_type = self & ~(ChannelType.OPTION_SCID_ALIAS | ChannelType.OPTION_ZEROCONF)
if basic_type not in [
ChannelType.OPTION_STATIC_REMOTEKEY,
- ChannelType.OPTION_ANCHOR_OUTPUTS | ChannelType.OPTION_STATIC_REMOTEKEY,
ChannelType.OPTION_ANCHORS_ZERO_FEE_HTLC_TX | ChannelType.OPTION_STATIC_REMOTEKEY
]:
raise ValueError("Channel type is not a valid flag combination.")
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.