use reactor clock in TreeRoutingTable instead of time module

This commit is contained in:
Jack Robison 2018-05-23 17:45:24 -04:00
parent d4e28216a0
commit c654bfe296
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -43,7 +43,8 @@ class TreeRoutingTable(object):
self._parentNodeID = parentNodeID
self._buckets = [kbucket.KBucket(rangeMin=0, rangeMax=2 ** constants.key_bits, node_id=self._parentNodeID)]
if not getTime:
from time import time as getTime
from twisted.internet import reactor
getTime = reactor.seconds
self._getTime = getTime
def addContact(self, contact):