]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - apt_p2p_Khashmir/ktable.py
Fixed justSeenNode in KTable to update the bucket properly.
[quix0rs-apt-p2p.git] / apt_p2p_Khashmir / ktable.py
index 3e60f5c37d0156e6f51c0f9d3543e689012424f4..864dfe50feaadf1732f3319e46f48d68403efdd9 100644 (file)
@@ -226,6 +226,12 @@ class KTable:
             n = self.buckets[i].l[it]
             tstamp = n.lastSeen
             n.updateLastSeen()
             n = self.buckets[i].l[it]
             tstamp = n.lastSeen
             n.updateLastSeen()
+            
+            # Move the node to the end and touch the bucket
+            del(self.buckets[i].l[it])
+            self.buckets[i].l.append(n)
+            self.buckets[i].touch()
+            
             return tstamp
     
     def invalidateNode(self, n):
             return tstamp
     
     def invalidateNode(self, n):