Merge pull request #13 from SkyZH/patch-1
Clean up midpoint calculation in routing table.
This commit is contained in:
commit
b9b23e1131
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user