-
Notifications
You must be signed in to change notification settings - Fork 412
Improve logging of pathfinding behavior #2011
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
Closed
Closed
Changes from 14 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
9073b8d
first commit
Sharmalm 02dddb4
second commit
Sharmalm 0312c2b
original
Sharmalm 3cdb8ed
first logging
Sharmalm b6ac4ec
Merge remote-tracking branch 'origin/main'
Sharmalm cfe611a
fifth commit
Sharmalm 5bd7708
third commit
Sharmalm 87eef3f
fourth commit
Sharmalm bb6c7f6
Merge branch 'lightningdevkit:main' into main
Sharmalm aef2aa6
Merge branch 'lightningdevkit:main' into main
Sharmalm 4a2c289
sixth commit
Sharmalm a8781ca
seventh commit
Sharmalm 0e5e8a6
eight commit
Sharmalm 3240053
Merge branch 'lightningdevkit:main' into main
Sharmalm b913098
Merge branch 'lightningdevkit:main' into main
Sharmalm 8d2a85d
ninth
Sharmalm fe93ed8
Merge branch 'lightningdevkit:main' into main
Sharmalm 6da0e06
access hashmap
Sharmalm 78dbb77
Merge remote-tracking branch 'origin/main'
Sharmalm 0be98f5
Merge branch 'lightningdevkit:main' into main
Sharmalm c830123
Merge branch 'lightningdevkit:main' into main
Sharmalm 9bc34a1
improving hashmap conditions
Sharmalm 1969bb7
Merge remote-tracking branch 'refs/remotes/origin/main'
Sharmalm 7febd5b
Merge branch 'lightningdevkit:main' into main
Sharmalm 4364e18
correction
Sharmalm 34d21dc
Merge branch 'lightningdevkit:main' into main
Sharmalm 592f615
test function
Sharmalm c633d31
Merge remote-tracking branch 'refs/remotes/origin/main'
Sharmalm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1267,6 +1267,29 @@ where L::Target: Logger { | |
// around again with a higher amount. | ||
if !contributes_sufficient_value || exceeds_max_path_length || | ||
exceeds_cltv_delta_limit || payment_failed_on_this_channel { | ||
let empty_vec: Vec<&ChannelDetails> = Vec::new(); | ||
let target = match first_hop_targets.get(&NodeId::from_pubkey(&our_node_pubkey)) { | ||
Some(value) => value, | ||
None => { | ||
&empty_vec | ||
} | ||
}; | ||
for channel_details in target { | ||
if let Some(short_channel_id_target) = channel_details.short_channel_id { | ||
if short_channel_id == short_channel_id_target { // short_channel_id is hop id of candidate. | ||
if !contributes_sufficient_value { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should replicate checking on the individual bools here, rather we can just break the big |
||
log_trace!(logger, "First Hop {short_channel_id} is excluded due to insufficient balance"); | ||
} else if exceeds_max_path_length { | ||
log_trace!(logger, "First Hop {short_channel_id} is excluded due to candidate hop excluded max path length"); | ||
} else if exceeds_cltv_delta_limit { | ||
log_trace!(logger, "First Hop {short_channel_id} is excluded beacause it exceed the maximum total cltv expiry limit"); | ||
} else if payment_failed_on_this_channel { | ||
log_trace!(logger, "First Hop {short_channel_id} is excluded beacause it was failed previously"); | ||
} | ||
|
||
} | ||
} | ||
} | ||
// Path isn't useful, ignore it and move on. | ||
} else if may_overpay_to_meet_path_minimum_msat { | ||
hit_minimum_limit = true; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 you're looking for
and then can just move the
for
inside? An alternative would be to use.unwrap_or(Vec::new())
or similar.