mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-29 09:41:34 +00:00
Use a Multihash in AddrComponent::P2P, drop cid (#407)
* Use a Multihash in AddrComponent::P2P * Remove the cid crate from the repo
This commit is contained in:
committed by
Benjamin Kampmann
parent
d4b98e8646
commit
d94fe1b831
@ -146,7 +146,7 @@ impl Peer {
|
||||
pub(crate) fn from(mut addr: Multiaddr) -> Option<Peer> {
|
||||
match addr.pop() {
|
||||
Some(AddrComponent::P2P(id)) => {
|
||||
PeerId::from_bytes(id.to_bytes()).ok().map(|pid| {
|
||||
PeerId::from_multihash(id).ok().map(|pid| {
|
||||
if addr.iter().count() == 0 {
|
||||
Peer {
|
||||
id: pid,
|
||||
|
Reference in New Issue
Block a user