Skip to content

Commit e3a1b8a

Browse files
committed
f - Rename destination to target
1 parent a950b8f commit e3a1b8a

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

lightning/src/routing/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ use routing::network_graph::NodeId;
1919
///
2020
/// Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
2121
pub trait Score {
22-
/// Returns the fee in msats willing to be paid to avoid routing through the given channel from
23-
/// `source` to `destination`.
24-
fn channel_penalty_msat(
25-
&self, short_channel_id: u64, source: &NodeId, destination: &NodeId
26-
) -> u64;
22+
/// Returns the fee in msats willing to be paid to avoid routing through the given channel
23+
/// in the direction from `source` to `target`.
24+
fn channel_penalty_msat(&self, short_channel_id: u64, source: &NodeId, target: &NodeId) -> u64;
2725
}

lightning/src/routing/router.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4385,7 +4385,7 @@ mod tests {
43854385
}
43864386

43874387
impl routing::Score for BadChannelScorer {
4388-
fn channel_penalty_msat(&self, short_channel_id: u64, _source: &NodeId, _destination: &NodeId) -> u64 {
4388+
fn channel_penalty_msat(&self, short_channel_id: u64, _source: &NodeId, _target: &NodeId) -> u64 {
43894389
if short_channel_id == self.short_channel_id { u64::max_value() } else { 0 }
43904390
}
43914391
}
@@ -4395,8 +4395,8 @@ mod tests {
43954395
}
43964396

43974397
impl routing::Score for BadNodeScorer {
4398-
fn channel_penalty_msat(&self, _short_channel_id: u64, _source: &NodeId, destination: &NodeId) -> u64 {
4399-
if *destination == self.node_id { u64::max_value() } else { 0 }
4398+
fn channel_penalty_msat(&self, _short_channel_id: u64, _source: &NodeId, target: &NodeId) -> u64 {
4399+
if *target == self.node_id { u64::max_value() } else { 0 }
44004400
}
44014401
}
44024402

lightning/src/routing/scorer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl Default for Scorer {
7474

7575
impl routing::Score for Scorer {
7676
fn channel_penalty_msat(
77-
&self, _short_channel_id: u64, _source: &NodeId, _destination: &NodeId
77+
&self, _short_channel_id: u64, _source: &NodeId, _target: &NodeId
7878
) -> u64 {
7979
self.base_penalty_msat
8080
}

0 commit comments

Comments
 (0)