From: burris Date: Tue, 1 Oct 2002 05:05:28 +0000 (+0000) Subject: no longer keep our own node in table X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=41e93f42542e7e958c29a0dc57b99d921ff82c4d;p=quix0rs-apt-p2p.git no longer keep our own node in table --- 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]