we dont always want to encode key here. bucket.keyInRange() already does it when necessary

This commit is contained in:
Alex Grintsvayg 2017-04-04 15:00:33 -04:00
parent bee67117c8
commit 99e4f9b00b

View file

@ -308,10 +308,9 @@ class TreeRoutingTable(RoutingTable):
@return: The index of the k-bucket responsible for the specified key
@rtype: int
"""
valKey = long(key.encode('hex'), 16)
i = 0
for bucket in self._buckets:
if bucket.keyInRange(valKey):
if bucket.keyInRange(key):
return i
else:
i += 1