Only correct time if we have at least 9 connected peers

This commit is contained in:
shortcutme 2020-01-22 16:37:07 +01:00
parent 835174270e
commit 238ede9419
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 1 additions and 1 deletions

View File

@ -360,7 +360,7 @@ class ConnectionServer(object):
for connection in self.connections
if connection.handshake.get("time") and connection.last_ping_delay
])
if len(corrections) < 6:
if len(corrections) < 9:
return 0.0
mid = int(len(corrections) / 2 - 1)
median = (corrections[mid - 1] + corrections[mid] + corrections[mid + 1]) / 3