From 21a80650b07f26f054a59b8d2bb76bfe05cb8ef7 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Wed, 5 Sep 2018 14:32:23 +0200 Subject: [PATCH] Cache timecorrection value --- src/Connection/ConnectionServer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Connection/ConnectionServer.py b/src/Connection/ConnectionServer.py index ab1a06ee..2a60af64 100644 --- a/src/Connection/ConnectionServer.py +++ b/src/Connection/ConnectionServer.py @@ -48,6 +48,8 @@ class ConnectionServer(object): self.num_incoming = 0 self.num_outgoing = 0 + self.timecorrection = 0.0 + # Bittorrent style peerid self.peer_id = "-UT3530-%s" % CryptHash.random(12, "base64") @@ -280,6 +282,8 @@ class ConnectionServer(object): self.has_internet = True self.onInternetOnline() + self.timecorrection = self.getTimecorrection() + if time.time() - s > 0.01: self.log.debug("Connection cleanup in %.3fs" % (time.time() - s)) self.log.debug("Checkconnections ended")