Browse Source

Remove old trampoline compatibility bits from invoices

bits 50/51 are now used on the network (as option_zeroconf)
patch-4
ThomasV 2 years ago
parent
commit
4366055ada
  1. 14
      electrum/lnutil.py
  2. 6
      electrum/trampoline.py

14
electrum/lnutil.py

@ -1097,20 +1097,6 @@ class LnFeatures(IntFlag):
_ln_feature_contexts[OPTION_TRAMPOLINE_ROUTING_REQ] = (LNFC.INIT | LNFC.NODE_ANN | LNFC.INVOICE)
_ln_feature_contexts[OPTION_TRAMPOLINE_ROUTING_OPT] = (LNFC.INIT | LNFC.NODE_ANN | LNFC.INVOICE)
# allow old Electrum wallets to pay us with trampoline
OPTION_TRAMPOLINE_ROUTING_REQ_COMPAT_ELECTRUM = 1 << 24
OPTION_TRAMPOLINE_ROUTING_OPT_COMPAT_ELECTRUM = 1 << 25
_ln_feature_contexts[OPTION_TRAMPOLINE_ROUTING_REQ_COMPAT_ELECTRUM] = (LNFC.INVOICE)
_ln_feature_contexts[OPTION_TRAMPOLINE_ROUTING_OPT_COMPAT_ELECTRUM] = (LNFC.INVOICE)
# allow old Phoenix wallets to pay us with trampoline
OPTION_TRAMPOLINE_ROUTING_REQ_COMPAT_ECLAIR = 1 << 50
OPTION_TRAMPOLINE_ROUTING_OPT_COMPAT_ECLAIR = 1 << 51
_ln_feature_contexts[OPTION_TRAMPOLINE_ROUTING_REQ_COMPAT_ECLAIR] = (LNFC.INVOICE)
_ln_feature_contexts[OPTION_TRAMPOLINE_ROUTING_OPT_COMPAT_ECLAIR] = (LNFC.INVOICE)
OPTION_SHUTDOWN_ANYSEGWIT_REQ = 1 << 26
OPTION_SHUTDOWN_ANYSEGWIT_OPT = 1 << 27

6
electrum/trampoline.py

@ -102,11 +102,7 @@ def is_legacy_relay(invoice_features, r_tags) -> Tuple[bool, List[bytes]]:
"""
invoice_features = LnFeatures(invoice_features)
# trampoline-supporting wallets:
# OPTION_TRAMPOLINE_ROUTING_OPT_COMPAT_ECLAIR: old Phoenix/Eclair wallets
# OPTION_TRAMPOLINE_ROUTING_OPT_COMPAT_ELECTRUM: old Electrum wallets
if (invoice_features.supports(LnFeatures.OPTION_TRAMPOLINE_ROUTING_OPT)
or invoice_features.supports(LnFeatures.OPTION_TRAMPOLINE_ROUTING_OPT_COMPAT_ECLAIR)
or invoice_features.supports(LnFeatures.OPTION_TRAMPOLINE_ROUTING_OPT_COMPAT_ELECTRUM)):
if invoice_features.supports(LnFeatures.OPTION_TRAMPOLINE_ROUTING_OPT:
# If there are no r_tags (routing hints) included, the wallet doesn't have
# private channels and is probably directly connected to a trampoline node.
# Any trampoline node should be able to figure out a path to the receiver and

Loading…
Cancel
Save