Handle global onion address correctly in needConnections
This commit is contained in:
parent
3561ddf7d3
commit
c5f77a1c38
1 changed files with 5 additions and 2 deletions
|
@ -1078,7 +1078,10 @@ class Site(object):
|
||||||
continue
|
continue
|
||||||
peer = self.peers.get("%s:%s" % (connection.ip, connection.port))
|
peer = self.peers.get("%s:%s" % (connection.ip, connection.port))
|
||||||
if peer:
|
if peer:
|
||||||
if connection.target_onion and tor_manager.start_onions and tor_manager.getOnion(self.address) != connection.target_onion:
|
if connection.ip.endswith(".onion") and connection.target_onion and tor_manager.start_onions:
|
||||||
|
# Check if the connection is made with the onion address created for the site
|
||||||
|
valid_target_onions = (tor_manager.getOnion(self.address), tor_manager.getOnion("global"))
|
||||||
|
if connection.target_onion not in valid_target_onions:
|
||||||
continue
|
continue
|
||||||
if not peer.connection:
|
if not peer.connection:
|
||||||
peer.connect(connection)
|
peer.connect(connection)
|
||||||
|
|
Loading…
Reference in a new issue