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

Loading…
Cancel
Save