Commit e8629de5 authored by Julien Muchembled's avatar Julien Muchembled

Do not kill a preferred tunnel if it would recreate the same tunnel afterwards

parent 721f9d43
...@@ -840,7 +840,8 @@ class TunnelManager(BaseTunnelManager): ...@@ -840,7 +840,8 @@ class TunnelManager(BaseTunnelManager):
# Keep only a small number of tunnels if server is not reachable # Keep only a small number of tunnels if server is not reachable
# (user should configure NAT properly). # (user should configure NAT properly).
if (self._client_count if self._served or self._disconnected else if (self._client_count if self._served or self._disconnected else
min(2, self._client_count)) <= len(peer_set): min(2, self._client_count)) <= len(peer_set) and \
peer_set != self._neighbour_set:
prefix = min(peer_set, key=self._tunnelScore) prefix = min(peer_set, key=self._tunnelScore)
self._killing[prefix] = TunnelKiller(prefix, self, True) self._killing[prefix] = TunnelKiller(prefix, self, True)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment