Don't connect to yourself when hidden service

This commit is contained in:
Peter Šurda 2016-11-08 08:49:43 +01:00
parent a7f3afe5a6
commit 756f85c9f0
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -47,6 +47,9 @@ class outgoingSynSender(threading.Thread, StoppableThread):
shared.knownNodesLock.release() shared.knownNodesLock.release()
if shared.config.get('bitmessagesettings', 'socksproxytype') != 'none': if shared.config.get('bitmessagesettings', 'socksproxytype') != 'none':
if peer.host.find(".onion") == -1: if peer.host.find(".onion") == -1:
# don't connect to self
if peer.host == shared.config.get('bitmessagesettings', 'onionhostname') and peer.port == shared.config.getint("bitmessagesettings", "onionport"):
continue
priority /= 10 # hidden services have 10x priority over plain net priority /= 10 # hidden services have 10x priority over plain net
elif peer.host.find(".onion") != -1: # onion address and so proxy elif peer.host.find(".onion") != -1: # onion address and so proxy
continue continue