]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - khashmir.py
automatically check responses to make sure it's from the node
[quix0rs-apt-p2p.git] / khashmir.py
index 03c67abba0db736ac2b9f26a8989a43c1f63c384..390d8a9dcb0a458c47e40a66af7c4c286572a3fb 100644 (file)
@@ -130,7 +130,7 @@ class Khashmir(xmlrpc.XMLRPC):
                    def default(err, node=node, table=table):
                        table.nodeFailed(node)
                    df = node.storeValue(key, value, self.node.senderDict())
-                   df.addCallback(cb)
+                   df.addCallbacks(cb, lambda x: None)
        # this call is asynch
        self.findNode(key, _storeValueForKey)
        
@@ -155,9 +155,6 @@ class Khashmir(xmlrpc.XMLRPC):
        
            def _notStaleNodeHandler(sender, old=old):
                """ called when we get a pong from the old node """
-               sender, conn = sender
-               if conn['host']:
-                   sender['host'] = conn['host']
                sender = Node().initWithDict(sender)
                if sender.id == old.id:
                    self.table.justSeenNode(old)