]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
no longer keep our own node in table
authorburris <burris>
Tue, 1 Oct 2002 05:05:28 +0000 (05:05 +0000)
committerburris <burris>
Tue, 1 Oct 2002 05:05:28 +0000 (05:05 +0000)
ktable.py

index aa86eb9bb66895024349a513afaa3b822a7764b6..5bbe8d9209944ca73186c8720d1671d10bd40b70 100644 (file)
--- 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]