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)
This commit is contained in:
@@ -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()])
|
||||||
|
|||||||
Reference in New Issue
Block a user