From e2b748a108fb8c49a069adb2d38ffdeb2a2ef4b2 Mon Sep 17 00:00:00 2001 From: Brian Muller Date: Mon, 13 Jan 2014 22:41:31 -0500 Subject: [PATCH] fixed stun call --- kademlia/network.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kademlia/network.py b/kademlia/network.py index 6f6d9e5..2aed90b 100644 --- a/kademlia/network.py +++ b/kademlia/network.py @@ -197,12 +197,13 @@ class Server(object): C{list} will be empty. """ def handle(results): - ips = [ result[0] for result in results if result is not None ] + ips = [ result[1][0] for result in results if result[0] ] self.log.debug("other nodes think our ip is %s" % str(ips)) return ips + ds = [] for neighbor in self.bootstrappableNeighbors(): - ds.append(self.protocol.router.stun(neighbor)) + ds.append(self.protocol.stun(neighbor)) return defer.gatherResults(ds).addCallback(handle) def get(self, key):