Skip to content
New issue

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

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

Already on GitHub? # to your account

Duplicate blacklist check in pubsub #153

Closed
paralin opened this issue Jan 20, 2019 · 3 comments
Closed

Duplicate blacklist check in pubsub #153

paralin opened this issue Jan 20, 2019 · 3 comments
Assignees

Comments

@paralin
Copy link

paralin commented Jan 20, 2019

https://github.com/libp2p/go-libp2p-pubsub/blob/master/pubsub.go#L294

			if p.blacklist.Contains(pid) {
				log.Warning("already have connection to peer: ", pid)
				continue
			}

			if p.blacklist.Contains(pid) {
				log.Warning("ignoring connection from blacklisted peer: ", pid)
				continue
			}

The second if should always be false, correct?

blame cc @vyzo

@vyzo
Copy link
Collaborator

vyzo commented Jan 20, 2019

Ugh, the first one should be a check in the connection table; thanks for catching.

@ghost ghost assigned vyzo Jan 20, 2019
@ghost ghost added the in progress label Jan 20, 2019
@vyzo
Copy link
Collaborator

vyzo commented Jan 20, 2019

#154 fixes it.

@vyzo
Copy link
Collaborator

vyzo commented Jan 20, 2019

this bug came to existence when the blacklist was promoted to an interface; initially there were two map checks, and they became two checks on the same object.

@vyzo vyzo closed this as completed in #154 Jan 20, 2019
@ghost ghost removed the in progress label Jan 20, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants