X-Git-Url: https://git.mxchange.org/?p=quix0rs-apt-p2p.git;a=blobdiff_plain;f=apt_dht_Khashmir%2Factions.py;fp=apt_dht_Khashmir%2Factions.py;h=b8f5c8ccd2c2ff75d3fe5d2ff83d7eb44a091dbe;hp=27cb5d814526ef3c2b77c613945f4fbc55cb0079;hb=e6cb61cfc53cc379909c64396f338505011203d4;hpb=08a0b4dcbb7faad2141cc76cd914b9de611bedd9 diff --git a/apt_dht_Khashmir/actions.py b/apt_dht_Khashmir/actions.py index 27cb5d8..b8f5c8c 100644 --- a/apt_dht_Khashmir/actions.py +++ b/apt_dht_Khashmir/actions.py @@ -5,6 +5,7 @@ from twisted.internet import reactor from twisted.python import log from khash import intify +from util import uncompact class ActionBase: """ base class for some long running asynchronous proccesses like finding nodes or values """ @@ -50,7 +51,8 @@ class FindNode(ActionBase): return self.outstanding = self.outstanding - 1 self.answered[dict["id"]] = 1 - for node in l: + for compact_node in l: + node = uncompact(compact_node) n = self.caller.Node(node) if not self.found.has_key(n.id): self.found[n.id] = n @@ -125,7 +127,8 @@ class GetValue(FindNode): # go through nodes # if we have any closer than what we already got, query them if dict.has_key('nodes'): - for node in dict['nodes']: + for compact_node in dict['nodes']: + node = uncompact(compact_node) n = self.caller.Node(node) if not self.found.has_key(n.id): self.found[n.id] = n