mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-04-30 13:12:15 +00:00
Check multiaddr has valid peer id component or none at all. We don't want to cache a multiaddr with a purposely wrong multiaddr. e.g. something that ends with .../p2p/some-other-peer. While this should fail to dial because we [check this before dialing](https://github.com/libp2p/rust-libp2p/blob/master/core/src/connection/pool/concurrent_dial.rs#L144), it's better to not cache this in the first place.