Periodic refresh issue fixed for Python3

This commit is contained in:
Eloahman 2016-08-02 21:55:49 +08:00 committed by Brian Muller
parent 464ae5bd1f
commit 080ed21627
2 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ class Server(object):
for id in self.protocol.getRefreshIDs(): for id in self.protocol.getRefreshIDs():
node = Node(id) node = Node(id)
nearest = self.protocol.router.findNeighbors(node, self.alpha) nearest = self.protocol.router.findNeighbors(node, self.alpha)
spider = NodeSpiderCrawl(self.protocol, node, nearest) spider = NodeSpiderCrawl(self.protocol, node, nearest, self.ksize, self.alpha)
ds.append(spider.find()) ds.append(spider.find())
# do our crawling # do our crawling

View File

@ -22,7 +22,7 @@ class KademliaProtocol(RPCProtocol):
""" """
ids = [] ids = []
for bucket in self.router.getLonelyBuckets(): for bucket in self.router.getLonelyBuckets():
ids.append(random.randint(*bucket.range)) ids.append(random.randint(*bucket.range).to_bytes(20, byteorder='big'))
return ids return ids
def rpc_stun(self, sender): def rpc_stun(self, sender):