-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: 'ipfs routing findpeer' explicitly fails when searching for self #9903
Conversation
@hacdias : can you provide a quick review please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine, but perhaps a test would be great.
Not sure on how to write a test case for that scenario itself as we need the daemon running while we want to test this command. Any leads would be great. Thank you |
@susarlanikhilesh you can write a test inside |
@hacdias Can you please check if that's sufficient. |
@@ -301,6 +301,10 @@ var findPeerRoutingCmd = &cmds.Command{ | |||
return err | |||
} | |||
|
|||
if pid == nd.Identity { | |||
return ErrSelfUnsupported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this works but this seems very ad-hoc.
I think this is covering up a bug, ideally the routing layers like dht, ... would return this error.
This is better than nothing still.
d1a79c7
to
88fc407
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
Closes #9898