-
- /// Get network addresses by node id.
- /// Returns None if the requested node is completely unknown,
- /// or if node announcement for the node was never received.
- pub fn get_addresses(&self, pubkey: &PublicKey) -> Option<Vec<NetAddress>> {
- let network = self.network_graph.read().unwrap();
- if let Some(node) = network.get_nodes().get(pubkey) {
- if let Some(node_info) = node.announcement_info.as_ref() {
- return Some(node_info.addresses.clone())
- }
- }
- None
- }
-
- /// Dumps the entire network view of this NetGraphMsgHandler to the logger provided in the constructor at
- /// level Trace
- pub fn trace_state(&self) {
- log_trace!(self, "{}", self.network_graph.read().unwrap());
- }