Merge pull request #618 from TheBlueMatt/2020-05-sample-c-bindings
[rust-lightning] / lightning / src / routing / network_graph.rs
index 6e51b7d092ab92b86067d71f45703213b31829f3..1a4a8c1a637e7a1e0c0df8a0294f0750265f40b8 100644 (file)
@@ -260,7 +260,7 @@ pub struct DirectionalChannelInfo {
        /// Mostly redundant with the data we store in fields explicitly.
        /// Everything else is useful only for sending out for initial routing sync.
        /// Not stored if contains excess data to prevent DoS.
-       pub last_update_message: Option<msgs::ChannelUpdate>,
+       pub last_update_message: Option<ChannelUpdate>,
 }
 
 impl fmt::Display for DirectionalChannelInfo {
@@ -300,7 +300,7 @@ pub struct ChannelInfo {
        /// Mostly redundant with the data we store in fields explicitly.
        /// Everything else is useful only for sending out for initial routing sync.
        /// Not stored if contains excess data to prevent DoS.
-       pub announcement_message: Option<msgs::ChannelAnnouncement>,
+       pub announcement_message: Option<ChannelAnnouncement>,
 }
 
 impl fmt::Display for ChannelInfo {
@@ -371,7 +371,7 @@ pub struct NodeAnnouncementInfo {
        /// Mostly redundant with the data we store in fields explicitly.
        /// Everything else is useful only for sending out for initial routing sync.
        /// Not stored if contains excess data to prevent DoS.
-       pub announcement_message: Option<msgs::NodeAnnouncement>
+       pub announcement_message: Option<NodeAnnouncement>
 }
 
 impl Writeable for NodeAnnouncementInfo {
@@ -526,13 +526,19 @@ impl fmt::Display for NetworkGraph {
 
 impl NetworkGraph {
        /// Returns all known valid channels' short ids along with announced channel info.
+       ///
+       /// (C-not exported) because we have no mapping for `BTreeMap`s
        pub fn get_channels<'a>(&'a self) -> &'a BTreeMap<u64, ChannelInfo> { &self.channels }
        /// Returns all known nodes' public keys along with announced node info.
+       ///
+       /// (C-not exported) because we have no mapping for `BTreeMap`s
        pub fn get_nodes<'a>(&'a self) -> &'a BTreeMap<PublicKey, NodeInfo> { &self.nodes }
 
        /// 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.
+       ///
+       /// (C-not exported) as there is no practical way to track lifetimes of returned values.
        pub fn get_addresses<'a>(&'a self, pubkey: &PublicKey) -> Option<&'a Vec<NetAddress>> {
                if let Some(node) = self.nodes.get(pubkey) {
                        if let Some(node_info) = node.announcement_info.as_ref() {