Skip to content

Commit a931dec

Browse files
committed
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.
1 parent 5bf58f0 commit a931dec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/routing/gossip.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,13 +1032,13 @@ impl<'a> DirectedChannelInfo<'a> {
10321032
///
10331033
/// Refers to the `node_id` forwarding the payment to the next hop.
10341034
#[inline]
1035-
pub(super) fn source(&self) -> &'a NodeId { if self.from_node_one { &self.channel.node_one } else { &self.channel.node_two } }
1035+
pub fn source(&self) -> &'a NodeId { if self.from_node_one { &self.channel.node_one } else { &self.channel.node_two } }
10361036

10371037
/// Returns the `node_id` of the target hop.
10381038
///
10391039
/// Refers to the `node_id` receiving the payment from the previous hop.
10401040
#[inline]
1041-
pub(super) fn target(&self) -> &'a NodeId { if self.from_node_one { &self.channel.node_two } else { &self.channel.node_one } }
1041+
pub fn target(&self) -> &'a NodeId { if self.from_node_one { &self.channel.node_two } else { &self.channel.node_one } }
10421042
}
10431043

10441044
impl<'a> fmt::Debug for DirectedChannelInfo<'a> {

0 commit comments

Comments
 (0)