Don't connect to self fix

- the hidden service don't connect to yourself fix was broken, this
  fixes the fix
This commit is contained in:
Peter Šurda 2016-11-14 20:20:41 +01:00
parent 54e3465575
commit b9748c55aa
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -47,10 +47,11 @@ 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:
priority /= 10 # hidden services have 10x priority over plain net
else:
# don't connect to self # don't connect to self
if peer.host == shared.config.get('bitmessagesettings', 'onionhostname') and peer.port == shared.config.getint("bitmessagesettings", "onionport"): if peer.host == shared.config.get('bitmessagesettings', 'onionhostname') and peer.port == shared.config.getint("bitmessagesettings", "onionport"):
continue continue
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
if priority <= 0.001: # everyone has at least this much priority if priority <= 0.001: # everyone has at least this much priority