From 41e93f42542e7e958c29a0dc57b99d921ff82c4d Mon Sep 17 00:00:00 2001 From: burris Date: Tue, 1 Oct 2002 05:05:28 +0000 Subject: [PATCH] no longer keep our own node in table --- ktable.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ktable.py b/ktable.py index aa86eb9..5bbe8d9 100644 --- a/ktable.py +++ b/ktable.py @@ -113,6 +113,8 @@ class KTable: contacted means that yes, we contacted THEM and we know the node is available """ assert(node.id != " "*20) + if node.id == self.node.id: + return # get the bucket for this node i = self. _bucketIndexForInt(node.int) ## check to see if node is in the bucket already @@ -144,7 +146,7 @@ class KTable: # bucket is full, check to see if self.node is in the bucket try: - me = self.buckets[i].l.index(self.node) + me = self.buckets[i].min <= self.node < self.buckets[i].max except ValueError: return self.buckets[i].l[0] -- 2.39.5