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

Next function returns own messages #537

Open
l0k18 opened this issue Jul 21, 2023 · 2 comments
Open

Next function returns own messages #537

l0k18 opened this issue Jul 21, 2023 · 2 comments

Comments

@l0k18
Copy link

l0k18 commented Jul 21, 2023

Sorry if this is a duplicate. It is happening with v0.9.3, which appears to be the current latest version.

The title really says it all. I added this code to my handler to abort doing any work if the sender is the receiver:

	if p.ReceivedFrom == ng.Listener.Host.ID() {
		return
	}

Yes, Listener.Host is libp2p.Host.

It seems to me that the Next function should not deliver messages that the pubsub sent. At least it should be an option to suppress it.

@vyzo
Copy link
Collaborator

vyzo commented Jul 27, 2023

This is the default behavior of broadcast protocols; a pr would be welcome if you want to add an option to disable this behavior.

@l0k18
Copy link
Author

l0k18 commented Jul 29, 2023

This is the default behavior of broadcast protocols; a pr would be welcome if you want to add an option to disable this behavior.

I will attach one to this issue in the near future, A parameter and that code more or less.

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

No branches or pull requests

2 participants