-
Notifications
You must be signed in to change notification settings - Fork 46
Trampoline: Improve channel selection logic #586
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
Conversation
5d19f06 to
3661788
Compare
3661788 to
133d5da
Compare
|
@JssDWt If you don't mind it would be nice to get your oppinion on the improved version! |
JssDWt
left a comment
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.
It looks very good to me! I can't find any real issues on the first pass.
| let lower = ch.min_htlc_out_msat; | ||
| let upper = ch.spendable_msat.min(target_msat); |
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.
Let's add a check that upper is not below lower.
Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
It makes more sense to filter directly from the get go instead of skipping channels that have an unsufficient spendable_msat amount and can cause zero value htlcs. Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
The way we allocated channels for a trampoline payment could lead to a case where we could get stuck selecting channels for a payment when the rest amount was lower than the lower bound of the channel. This commit introduces a new selection logic that tries to be greedy first but will split payments more carefully if it is actually needded. Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
133d5da to
32e64c3
Compare
The way we allocated channels for a trampoline payment could lead to a case where we could get stuck selecting channels for a payment when the rest amount was lower than the lower bound of the channel.
This PR introduces a new selection logic that tries to be greedy first but will split payments more carefully if it is actually needded.
Reviewers: Please check carefully and let me know if you need more tests.