]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - apt_dht_Khashmir/node.py
Added a shutdown method to the khasmir DHT.
[quix0rs-apt-p2p.git] / apt_dht_Khashmir / node.py
index 35dadc6eebc52ecff3d11a03616557f33ca4be17..dabe08cec4631b5a06e9b18d07262c75f01e464a 100644 (file)
@@ -4,8 +4,13 @@
 from time import time
 from types import InstanceType
 
+from twisted.trial import unittest
+
 import khash
 
+# magic id to use before we know a peer's id
+NULL_ID = 20 * '\0'
+
 class Node:
     """encapsulate contact info"""
     def __init__(self):
@@ -70,8 +75,6 @@ class Node:
         return self.num != a
 
 
-import unittest
-
 class TestNode(unittest.TestCase):
     def setUp(self):
         self.node = Node().init(khash.newID(), 'localhost', 2002)