Tidy API to be more consistent with recent decisions

This commit is contained in:
Paul Hauner
2019-08-22 14:37:47 +10:00
parent a8daf46d5f
commit b912e26b79
6 changed files with 92 additions and 26 deletions

View File

@@ -75,6 +75,11 @@ impl<T: BeaconChainTypes + 'static> Service<T> {
.clone()
}
/// Returns the local libp2p PeerID.
pub fn local_peer_id(&self) -> PeerId {
self.libp2p_service.lock().local_peer_id.clone()
}
/// Returns the list of `Multiaddr` that the underlying libp2p instance is listening on.
pub fn listen_multiaddrs(&self) -> Vec<Multiaddr> {
Swarm::listeners(&self.libp2p_service.lock().swarm)