1
0

Use new value of option_trampoline_routing flag, add it to our invoices.

Keep supporting old value for Eclair/Phoenix.
Do not add trampoline_routing_hints in invoices.
This commit is contained in:
ThomasV
2021-03-08 18:49:52 +01:00
parent 0491da2c66
commit 196b4c00a3
4 changed files with 21 additions and 36 deletions

View File

@@ -947,14 +947,15 @@ 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_TRAMPOLINE_ROUTING_REQ = 1 << 50
OPTION_TRAMPOLINE_ROUTING_OPT = 1 << 51
OPTION_TRAMPOLINE_ROUTING_REQ = 1 << 24
OPTION_TRAMPOLINE_ROUTING_OPT = 1 << 25
# We do not set trampoline_routing_opt in invoices, because the spec is not ready.
# This ensures that current version of Phoenix can pay us
# It also prevents Electrum from using t_tags from future implementations
_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)
_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)
# temporary
OPTION_TRAMPOLINE_ROUTING_REQ_ECLAIR = 1 << 50
OPTION_TRAMPOLINE_ROUTING_OPT_ECLAIR = 1 << 51
def validate_transitive_dependencies(self) -> bool:
# for all even bit set, set corresponding odd bit: