Cache timecorrection value

This commit is contained in:
shortcutme 2018-09-05 14:32:23 +02:00
parent 3b7ec3d913
commit 21a80650b0
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -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")