Include source and destination nodes in routing::Score#1133
Include source and destination nodes in routing::Score#1133TheBlueMatt merged 2 commits intolightningdevkit:mainfrom
Conversation
In order to make the scoring tests easier to read, only check the relevant RouteHop fields. The remaining fields are tested elsewhere. Expand the test to show the path used without scoring.
Codecov Report
@@ Coverage Diff @@
## main #1133 +/- ##
=======================================
Coverage 90.56% 90.56%
=======================================
Files 67 67
Lines 34567 34597 +30
=======================================
+ Hits 31305 31334 +29
- Misses 3262 3263 +1
Continue to review full report at Codecov.
|
| /// Scoring is in terms of fees willing to be paid in order to avoid routing through a channel. | ||
| pub trait Score { | ||
| /// Returns the fee in msats willing to be paid to avoid routing through the given channel. | ||
| fn channel_penalty_msat(&self, short_channel_id: u64) -> u64; |
There was a problem hiding this comment.
nit +"in the given direction" on the docs.
d8f0266 to
a950b8f
Compare
lightning/src/routing/mod.rs
Outdated
| pub trait Score { | ||
| /// Returns the fee in msats willing to be paid to avoid routing through the given channel. | ||
| /// Returns the fee in msats willing to be paid to avoid routing through the given channel from | ||
| /// `source` to `destination`. |
There was a problem hiding this comment.
This isn't the source and dest of the payment itself, right? Just the forwarder/forwardee of the given short_channel_id? Those names are a bit overloaded for me lol
There was a problem hiding this comment.
Correct. I could use the more general term target instead of destination and reword the docs a bit.
valentinewallace
left a comment
There was a problem hiding this comment.
Thanks, that makes it clearer for me
Expand routing::Score::channel_penalty_msat to include the source and target node ids of the channel. This allows scorers to avoid certain nodes altogether if desired.
e3a1b8a to
54f490c
Compare
|
Squashed without changed: |
Expand
routing::Score::channel_penalty_msatto include the source and target node ids of the channel. This allows scorers to avoid certain nodes altogether if desired.