Don't accept onion peers if we have no proxy
This commit is contained in:
parent
f7c95986bf
commit
74c5c3f817
@ -14,6 +14,7 @@ Version 1.6.1 (in progress)
|
||||
============================
|
||||
|
||||
* cleaner shutdown process with clear guarantees
|
||||
* onion peers are ignored if no tor proxy is available
|
||||
* add Motion coin (ocruzv)
|
||||
|
||||
Version 1.6 (19 July 2018)
|
||||
|
||||
@ -334,8 +334,9 @@ class PeerManager(object):
|
||||
retry = False
|
||||
new_peers = []
|
||||
for peer in peers:
|
||||
if not peer.is_public:
|
||||
if not peer.is_public or (peer.is_tor and not self.proxy):
|
||||
continue
|
||||
|
||||
matches = peer.matches(self.peers)
|
||||
if not matches:
|
||||
new_peers.append(peer)
|
||||
@ -499,16 +500,16 @@ class PeerManager(object):
|
||||
3) Retrying old peers at regular intervals.
|
||||
'''
|
||||
self.import_peers()
|
||||
await self.maybe_detect_proxy()
|
||||
|
||||
try:
|
||||
while True:
|
||||
await self.maybe_detect_proxy()
|
||||
await self.retry_peers()
|
||||
timeout = self.loop.call_later(WAKEUP_SECS,
|
||||
self.retry_event.set)
|
||||
await self.retry_event.wait()
|
||||
self.retry_event.clear()
|
||||
timeout.cancel()
|
||||
await self.retry_peers()
|
||||
finally:
|
||||
for session in list(PeerSession.sessions):
|
||||
session.abort()
|
||||
@ -537,9 +538,6 @@ class PeerManager(object):
|
||||
|
||||
peers = [peer for peer in self.peers if should_retry(peer)]
|
||||
|
||||
if self.env.force_proxy or any(peer.is_tor for peer in peers):
|
||||
await self.maybe_detect_proxy()
|
||||
|
||||
for peer in peers:
|
||||
peer.try_count += 1
|
||||
pairs = peer.connection_port_pairs()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user