Merge pull request #1133 from jkczyz/2021-10-expand-scorer
[rust-lightning] / lightning / src / routing / network_graph.rs
index 2a8c45c3bb47618cd3cec78c4be2d5e00a13b08c..f65b8fa657a5fc2e77da24a33578ecf51089e8c4 100644 (file)
@@ -1213,12 +1213,10 @@ impl ReadOnlyNetworkGraph<'_> {
        /// 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(&self, pubkey: &PublicKey) -> Option<&Vec<NetAddress>> {
+       pub fn get_addresses(&self, pubkey: &PublicKey) -> Option<Vec<NetAddress>> {
                if let Some(node) = self.nodes.get(&NodeId::from_pubkey(&pubkey)) {
                        if let Some(node_info) = node.announcement_info.as_ref() {
-                               return Some(&node_info.addresses)
+                               return Some(node_info.addresses.clone())
                        }
                }
                None
@@ -1815,6 +1813,7 @@ mod tests {
                                network_update: Some(NetworkUpdate::ChannelUpdateMessage {
                                        msg: valid_channel_update,
                                }),
+                               short_channel_id: None,
                                error_code: None,
                                error_data: None,
                        });
@@ -1840,6 +1839,7 @@ mod tests {
                                        short_channel_id,
                                        is_permanent: false,
                                }),
+                               short_channel_id: None,
                                error_code: None,
                                error_data: None,
                        });
@@ -1863,6 +1863,7 @@ mod tests {
                                        short_channel_id,
                                        is_permanent: true,
                                }),
+                               short_channel_id: None,
                                error_code: None,
                                error_data: None,
                        });