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

Entire blocklist logic being executed when blocklist option is not set #862

Closed
romaincointepas opened this issue Jul 15, 2016 · 2 comments
Closed
Labels
bug

Comments

@romaincointepas
Copy link

@romaincointepas romaincointepas commented Jul 15, 2016

Came across this while going over the code. It's probably not a big deal but I thought I would report it.

In https://github.com/feross/webtorrent/blob/master/index.js#L135, the code is still trying to load the IPSet even if opts.blocklist is undefined. self.blocked is then defined as an empty IPSet.

Because if (self.client.blocked) returns true in https://github.com/feross/webtorrent/blob/master/lib/torrent.js#L710-L732, the entire block of logic in addPeer() related to blocklist is always executed, even if originally opts.blocklist was not set.


  • WebTorrent version: 0.95.2
@feross feross added the bug label Jul 27, 2016
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jul 27, 2016

Fixed in 0.95.4. Thanks for the report!

@feross feross closed this Jul 27, 2016
@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.