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()
|
knownnodes.knownNodes[self.streamNumber][peer] = time.time()
|
||||||
else:
|
else:
|
||||||
while not self._stopped:
|
while not self._stopped:
|
||||||
with knownnodes.knownNodesLock:
|
try:
|
||||||
try:
|
with knownnodes.knownNodesLock:
|
||||||
peer, = random.sample(knownnodes.knownNodes[self.streamNumber], 1)
|
peer, = random.sample(knownnodes.knownNodes[self.streamNumber], 1)
|
||||||
except ValueError: # no known nodes
|
priority = (183600 - (time.time() - knownnodes.knownNodes[self.streamNumber][peer])) / 183600 # 2 days and 3 hours
|
||||||
self.stop.wait(1)
|
except ValueError: # no known nodes
|
||||||
continue
|
self.stop.wait(1)
|
||||||
priority = (183600 - (time.time() - knownnodes.knownNodes[self.streamNumber][peer])) / 183600 # 2 days and 3 hours
|
continue
|
||||||
if BMConfigParser().get('bitmessagesettings', 'socksproxytype') != 'none':
|
if BMConfigParser().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
|
priority /= 10 # hidden services have 10x priority over plain net
|
||||||
|
|
Loading…
Reference in New Issue
Block a user