From: benthecarman Date: Fri, 2 Feb 2024 14:14:51 +0000 (+0000) Subject: Make DirectedChannelInfo `source` and `target` public X-Git-Tag: v0.0.123-beta~86^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=a931decbbbc15ca7fdf090393da4e18a91e0be28;p=rust-lightning Make DirectedChannelInfo `source` and `target` public We use these params for our HubPreferentialScorer and without these utility functions then we have to manually do this and calculate which is the source and which is the target node. --- diff --git a/lightning/src/routing/gossip.rs b/lightning/src/routing/gossip.rs index 9c8fd40af..4c7a3762a 100644 --- a/lightning/src/routing/gossip.rs +++ b/lightning/src/routing/gossip.rs @@ -1032,13 +1032,13 @@ impl<'a> DirectedChannelInfo<'a> { /// /// Refers to the `node_id` forwarding the payment to the next hop. #[inline] - pub(super) fn source(&self) -> &'a NodeId { if self.from_node_one { &self.channel.node_one } else { &self.channel.node_two } } + pub fn source(&self) -> &'a NodeId { if self.from_node_one { &self.channel.node_one } else { &self.channel.node_two } } /// Returns the `node_id` of the target hop. /// /// Refers to the `node_id` receiving the payment from the previous hop. #[inline] - pub(super) fn target(&self) -> &'a NodeId { if self.from_node_one { &self.channel.node_two } else { &self.channel.node_one } } + pub fn target(&self) -> &'a NodeId { if self.from_node_one { &self.channel.node_two } else { &self.channel.node_one } } } impl<'a> fmt::Debug for DirectedChannelInfo<'a> {