Unnecessary locking
- there was a sleep inside a lock
This commit is contained in:
parent
741ac5ca05
commit
5d068ec84a
|
@ -40,13 +40,13 @@ class outgoingSynSender(threading.Thread, StoppableThread):
|
|||
knownnodes.knownNodes[self.streamNumber][peer] = time.time()
|
||||
else:
|
||||
while not self._stopped:
|
||||
with knownnodes.knownNodesLock:
|
||||
try:
|
||||
with knownnodes.knownNodesLock:
|
||||
peer, = random.sample(knownnodes.knownNodes[self.streamNumber], 1)
|
||||
priority = (183600 - (time.time() - knownnodes.knownNodes[self.streamNumber][peer])) / 183600 # 2 days and 3 hours
|
||||
except ValueError: # no known nodes
|
||||
self.stop.wait(1)
|
||||
continue
|
||||
priority = (183600 - (time.time() - knownnodes.knownNodes[self.streamNumber][peer])) / 183600 # 2 days and 3 hours
|
||||
if BMConfigParser().get('bitmessagesettings', 'socksproxytype') != 'none':
|
||||
if peer.host.find(".onion") == -1:
|
||||
priority /= 10 # hidden services have 10x priority over plain net
|
||||
|
|
Reference in New Issue
Block a user