-
Notifications
You must be signed in to change notification settings - Fork 461
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
Dont discover self #356
Comments
Additionally maybe log a warning like "WARN: Discovery module $NAME caused this peer to discover itself. This is a bug and should be reported at $URL" (url could be read from package.json, as npmjs.com currently does) |
While I think this is valuable I think having the warning code always be present might be unncessary. I think if we log an error we'll at least have the stack trace of where it came from and the frequency it happens. Additionally I think the right thing to do would be to add self discovery tests to https://github.com/libp2p/interface-peer-discovery (along with the other tests it should have), and get that added to each of the discovery service test suites. @mkg20001 what do you think about that approach? |
@jacobheun Tests sound great, should also be mandatory. About log: Put it in debug log. That should be enough, so developers know it's happening and can report bugs |
I added the error to debug for
I'll create an issue over at interface-discovery to track this. |
Original issue: https://github.com/libp2p/js-libp2p-switch/issues/331.
On peer discovery, if the peer happens to be us, we should avoid adding ourselves to the PeerBook and emitting a
peer:discovery
event.The text was updated successfully, but these errors were encountered: