-
Notifications
You must be signed in to change notification settings - Fork 414
Specify whether we have first-hop hints when routing #1309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify whether we have first-hop hints when routing #1309
Conversation
lightning/src/routing/router.rs
Outdated
payment_params.payee_pubkey, if allow_mpp { "with" } else { "without" }); | ||
log_trace!(logger, "Searching for a route from payer {} to payee {} {} MPP and {} first hops {}overriding the network graph", our_node_pubkey, | ||
payment_params.payee_pubkey, if allow_mpp { "with" } else { "without" }, | ||
if first_hops.is_some() { first_hops.as_ref().unwrap().len() } else { 0 }, if first_hops.is_some() { "" } else { "not " }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think since we have the 0
, can't we get rid of if first_hops.is_some() { "" } else { "not " }
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior is different between Some(0 length)
and None
, though - Some(0 length)
will always fail to route, None
will look at the network graph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think we should error at the beginning of the method for that first case then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean we do error, indicating that we have no path to use. I guess we could update the error message as well, but its nice to log the info as well because users may or may not log specific error messages, relying on our own logs instead (which is kinda annoying, but seems to be a recurring problem).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it does already get its own error message Cannot route when there are no outbound routes away from us
is unique to this case.
Codecov Report
@@ Coverage Diff @@
## main #1309 +/- ##
==========================================
+ Coverage 90.51% 90.90% +0.39%
==========================================
Files 71 72 +1
Lines 39210 41971 +2761
==========================================
+ Hits 35490 38155 +2665
- Misses 3720 3816 +96
Continue to review full report at Codecov.
|
This is incredibly useful when debugging issues with the router, and is somewhat of an oversight currently.
0844ba9
to
637e0d3
Compare
Squashed without diff:
|
This is incredibly useful when debugging issues with the router,
and is somewhat of an oversight currently.