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

some bugs fixed #21

merged 2 commits into from
Aug 2, 2016

Conversation

memwey
Copy link
Contributor

@memwey memwey commented Aug 1, 2016

kademlia/protocol.py KademliaProtocol:getRefreshIDs

ids.append(random.randint(_bucket.range))

bug fixed: Return a integer id. It should be bytes.

ids.append(random.randint(_bucket.range).to_bytes(20, byteorder='big'))

kademlia/network.py Server:_refresh_table

spider = NodeSpiderCrawl(self.protocol, node, nearest)

bug fixed: Lack of arguments

spider = NodeSpiderCrawl(self.protocol, node, nearest, self.ksize, self.alpha, self.node.long_id)

@@ -73,7 +73,7 @@ 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.

@bmuller
Copy link
Owner

bmuller commented Aug 1, 2016

Good catch on both points - thanks! If you update the first issue based on my comment (there's an extra parameter) then I'll happily merge. Thanks!

@bmuller bmuller merged commit 080ed21 into bmuller:python3.5 Aug 2, 2016
@bmuller
Copy link
Owner

bmuller commented Aug 2, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants