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: decapsulate ipfs from dht find peer #11

Merged
merged 1 commit into from
Mar 12, 2019

Conversation

vasco-santos
Copy link
Member

While js-libp2p does not handle this on libp2p/js-libp2p#323, this PR removes the /ipfs/{peer_id} from the multiaddress

@jacobheun
Copy link
Contributor

@vasco-santos I wonder if we should also decapsulate the addresses at the end of start in the custom Libp2p class. This would ensure the daemon isn't advertising /ipfs/ addresses, until libp2p/js-libp2p#323 is done.

@vasco-santos
Copy link
Member Author

I agree that it makes more sense to decapsulate the addresses at the end of start

@vasco-santos vasco-santos force-pushed the fix/decapsulate-ipfs-from-dht-find-peer branch from 563fa0b to d13d799 Compare March 7, 2019 10:32
src/libp2p.js Outdated
} catch (_) {
ma = m
}
return ma
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to replace map with forEach and do this.peerInfo.multiaddrs.replace(m, ma) here to avoid the additional iteration.

@vasco-santos vasco-santos force-pushed the fix/decapsulate-ipfs-from-dht-find-peer branch from d13d799 to 8fe49ed Compare March 7, 2019 11:56
@vasco-santos vasco-santos mentioned this pull request Mar 7, 2019
3 tasks
Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jacobheun jacobheun merged commit 190df09 into master Mar 12, 2019
@jacobheun jacobheun deleted the fix/decapsulate-ipfs-from-dht-find-peer branch March 12, 2019 08:19
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

Successfully merging this pull request may close these issues.

2 participants