]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - apt_p2p_Khashmir/node.py
Add $remote_fs dependency in init.d LSB header (Closes: #480645)
[quix0rs-apt-p2p.git] / apt_p2p_Khashmir / node.py
index c1300c74a08ee2f9e4538d531cd442ebd8fe3688..eff754b318cc5690c41f10470ff678f1a7b28f14 100644 (file)
@@ -1,5 +1,3 @@
-## Copyright 2002-2003 Andrew Loewenstern, All Rights Reserved
-# see LICENSE.txt for license information
 
 """Represents a node in the DHT.
 
@@ -16,7 +14,7 @@ import khash
 from util import compact
 
 # magic id to use before we know a peer's id
-NULL_ID = 20 * '\0'
+NULL_ID = khash.HASH_LENGTH * '\0'
 
 class Node:
     """Encapsulate a node's contact info.
@@ -141,6 +139,8 @@ class Node:
         if type(a) == InstanceType:
             a = a.num
         return self.num != a
+    def __hash__(self):
+        return hash(self.num)
 
 
 class TestNode(unittest.TestCase):