Store information about the local node in the topology (#772)

* Store information about the local node in the topology

* Fix build

* Store the external addresses in the topology
This commit is contained in:
Pierre Krieger
2018-12-13 19:06:13 +01:00
committed by GitHub
parent e2ff74994c
commit 40a503fd63
9 changed files with 87 additions and 54 deletions

View File

@ -22,7 +22,7 @@ use crate::service::{MdnsService, MdnsPacket};
use futures::prelude::*;
use libp2p_core::protocols_handler::{DummyProtocolsHandler, ProtocolsHandler};
use libp2p_core::swarm::{ConnectedPoint, NetworkBehaviour, NetworkBehaviourAction, PollParameters};
use libp2p_core::{Multiaddr, PeerId, multiaddr::Protocol, topology::MemoryTopology};
use libp2p_core::{Multiaddr, PeerId, multiaddr::Protocol, topology::MemoryTopology, topology::Topology};
use smallvec::SmallVec;
use std::{fmt, io, iter, marker::PhantomData, time::Duration};
use tokio_io::{AsyncRead, AsyncWrite};
@ -55,7 +55,7 @@ impl<TSubstream> Mdns<TSubstream> {
}
/// Trait that must be implemented on the network topology for it to be usable with `Mdns`.
pub trait MdnsTopology {
pub trait MdnsTopology: Topology {
/// Adds an address discovered by mDNS.
///
/// Will never be called with the local peer ID.