diff --git a/kademlia/routing.py b/kademlia/routing.py index a79a988..5bde1bf 100644 --- a/kademlia/routing.py +++ b/kademlia/routing.py @@ -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():