Browse Source

hardcoded trampolines: do not mix testnet nodes and unitests.

(This was added in 3a7f5373ac. Not sure what the reason is, but
it triggers UNKNOWN_NEXT_PEER errors, that in turn affect routing
choices, e.g. fallback to single trampoline route)
patch-4
ThomasV 2 years ago
parent
commit
99c4c75c9d
  1. 13
      electrum/trampoline.py

13
electrum/trampoline.py

@ -71,15 +71,14 @@ TRAMPOLINE_NODES_SIGNET = {
_TRAMPOLINE_NODES_UNITTESTS = {} # used in unit tests
def hardcoded_trampoline_nodes() -> Mapping[str, LNPeerAddr]:
nodes = {}
if constants.net.NET_NAME == "mainnet":
nodes.update(TRAMPOLINE_NODES_MAINNET)
if _TRAMPOLINE_NODES_UNITTESTS:
return _TRAMPOLINE_NODES_UNITTESTS
elif constants.net.NET_NAME == "mainnet":
return TRAMPOLINE_NODES_MAINNET
elif constants.net.NET_NAME == "testnet":
nodes.update(TRAMPOLINE_NODES_TESTNET)
return TRAMPOLINE_NODES_TESTNET
elif constants.net.NET_NAME == "signet":
nodes.update(TRAMPOLINE_NODES_SIGNET)
nodes.update(_TRAMPOLINE_NODES_UNITTESTS)
return nodes
return TRAMPOLINE_NODES_SIGNET
def trampolines_by_id():
return dict([(x.pubkey, x) for x in hardcoded_trampoline_nodes().values()])

Loading…
Cancel
Save