Skip to content

Commit 7a106f9

Browse files
f docs + TODO
1 parent dcf2129 commit 7a106f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightning/src/routing/onion_message.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ use prelude::*;
2222

2323
/// Finds a route from us to the given `destination` node.
2424
/// If we have private channels, it may be useful to fill in `first_hops` with the results from
25-
/// [`ChannelManager::list_usable_channels`].
25+
/// [`ChannelManager::list_usable_channels`]. If `first_hops` is not filled in, connected peers
26+
/// without public channels will not be forwarded over.
2627
///
2728
/// [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
2829
pub fn find_path<L: Deref, GL: Deref>(
@@ -99,6 +100,8 @@ struct PathBuildingHop {
99100
impl PartialOrd for PathBuildingHop {
100101
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
101102
// We need a min-heap, whereas `BinaryHeap`s are a max-heap, so compare the costs in reverse.
103+
// TODO: randomize which node is selected if they are equal-cost. Currently there is an
104+
// incentive to grind lower node ids to attract more message forwards.
102105
other.cost.partial_cmp(&self.cost)
103106
}
104107
}

0 commit comments

Comments
 (0)