From f5b430b56735db555e58a10ff9c7711ba5856b5f Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Tue, 28 Feb 2017 09:40:28 +0100 Subject: [PATCH] Excessive random seeding - outgoing thread was calling a seed reinit before each peer selection. This is not necessary, just init when the thread starts --- src/class_outgoingSynSender.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/class_outgoingSynSender.py b/src/class_outgoingSynSender.py index 924961fb..c4f385c3 100644 --- a/src/class_outgoingSynSender.py +++ b/src/class_outgoingSynSender.py @@ -25,6 +25,7 @@ class outgoingSynSender(threading.Thread, StoppableThread): def __init__(self): threading.Thread.__init__(self, name="outgoingSynSender") self.initStop() + random.seed() def setup(self, streamNumber, selfInitiatedConnections): self.streamNumber = streamNumber @@ -83,11 +84,9 @@ class outgoingSynSender(threading.Thread, StoppableThread): self.stop.wait(10) if state.shutdown: break - random.seed() peer = self._getPeer() while peer in shared.alreadyAttemptedConnectionsList or peer.host in shared.connectedHostsList: # print 'choosing new sample' - random.seed() peer = self._getPeer() self.stop.wait(1) if self._stopped: