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:
Pierre Krieger
2018-08-10 17:47:02 +02:00
committed by Benjamin Kampmann
parent d4b98e8646
commit d94fe1b831
20 changed files with 70 additions and 666 deletions

View File

@ -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,