projects
/
quix0rs-apt-p2p.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fixed justSeenNode in KTable to update the bucket properly.
[quix0rs-apt-p2p.git]
/
apt_p2p_Khashmir
/
ktable.py
diff --git
a/apt_p2p_Khashmir/ktable.py
b/apt_p2p_Khashmir/ktable.py
index 3e60f5c37d0156e6f51c0f9d3543e689012424f4..864dfe50feaadf1732f3319e46f48d68403efdd9 100644
(file)
--- a/
apt_p2p_Khashmir/ktable.py
+++ b/
apt_p2p_Khashmir/ktable.py
@@
-226,6
+226,12
@@
class KTable:
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):