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

fix: peerRouting.findPeer() trying to find self #941

Merged
merged 5 commits into from
May 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/peer-routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ class PeerRouting {
throw errCode(new Error('No peer routers available'), 'NO_ROUTERS_AVAILABLE')
}

if (id._idB58String == this._peerId._idB58String) throw errCode(new Error('Cannot search for self'), 'ERR_DIALED_SELF')
zeim839 marked this conversation as resolved.
Show resolved Hide resolved

const output = await pipe(
merge(
...this._routers.map(router => [router.findPeer(id, options)])
Expand Down