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

@ -18,11 +18,14 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
use libp2p_core::{topology::MemoryTopology, Multiaddr, PeerId};
use libp2p_core::{Multiaddr, PeerId};
use libp2p_core::topology::{MemoryTopology, Topology};
/// Trait required on the topology for the identify system to store addresses.
pub trait IdentifyTopology {
pub trait IdentifyTopology: Topology {
/// Adds to the topology an address discovered through identification.
///
/// > **Note**: Will never be called with the local peer ID.
fn add_identify_discovered_addrs<TIter>(&mut self, peer: &PeerId, addr: TIter)
where
TIter: Iterator<Item = Multiaddr>;