You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2021. It is now read-only.
Currently peerInfo.multiaddrs.replace simply deletes all instances of the existing addresses and pushes the new addresses onto the internal array. This prevents the multiaddr set from maintaining any type of order.
Ideally, I think replace should insert the new addresses at the first index on the existing addresses. This would allow PeerInfo to maintain an order of preference. In libp2p-switch we already deprioritize circuit addresses by adding them to the end of the list. If any addresses are replaced during listening, it's possible that an unwanted order could occur.
For example, currently in js-ipfs addresses before start for nodejs would look like:
Because the tcp wildcard addresses are replaced, they end up getting added after/p2p-websocket-star/, instead of inserted in the place of the old addresses.