Merge pull request #13 from SkyZH/patch-1

Clean up midpoint calculation in routing table.
This commit is contained in:
Brian Muller 2015-10-16 12:03:18 -04:00
commit b9b23e1131
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class KBucket(object):
return self.nodes.values()
def split(self):
midpoint = self.range[1] - ((self.range[1] - self.range[0]) / 2)
midpoint = (self.range[0] + self.range[1]) / 2
one = KBucket(self.range[0], midpoint, self.ksize)
two = KBucket(midpoint + 1, self.range[1], self.ksize)
for node in self.nodes.values():