Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some bugs fixed #21

Merged
merged 2 commits into from
Aug 2, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kademlia/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def _refresh_table(self):
for id in self.protocol.getRefreshIDs():
node = Node(id)
nearest = self.protocol.router.findNeighbors(node, self.alpha)
spider = NodeSpiderCrawl(self.protocol, node, nearest)
spider = NodeSpiderCrawl(self.protocol, node, nearest, self.ksize, self.alpha, self.node.long_id)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I think there's one extra argument though (self.node.long_id).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Sorry. I use that in my project to record the crawl creator.

ds.append(spider.find())

# do our crawling
Expand Down
2 changes: 1 addition & 1 deletion kademlia/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def getRefreshIDs(self):
"""
ids = []
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

def rpc_stun(self, sender):
Expand Down