Allows Libp2p service to be read outside network thread

This commit is contained in:
Age Manning
2019-07-24 17:45:31 +10:00
parent 7d38cba252
commit ae96325c81
6 changed files with 47 additions and 56 deletions

View File

@@ -171,6 +171,11 @@ impl<TSubstream: AsyncRead + AsyncWrite> Behaviour<TSubstream> {
pub fn send_rpc(&mut self, peer_id: PeerId, rpc_event: RPCEvent) {
self.serenity_rpc.send_rpc(peer_id, rpc_event);
}
/* Discovery / Peer management functions */
pub fn connected_peers(&self) -> usize {
self.discovery.connected_peers()
}
}
/// The types of events than can be obtained from polling the behaviour.