From a931decbbbc15ca7fdf090393da4e18a91e0be28 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 2 Feb 2024 14:14:51 +0000 Subject: [PATCH] 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. --- lightning/src/routing/gossip.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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> { -- 2.39.5