Prioritize private channels when relaying payments#3248
Merged
Conversation
pm47
reviewed
Feb 10, 2026
eclair-core/src/main/scala/fr/acinq/eclair/payment/relay/ChannelRelay.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/relay/ChannelRelay.scala
Show resolved
Hide resolved
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3248 +/- ##
==========================================
+ Coverage 86.43% 88.36% +1.93%
==========================================
Files 242 218 -24
Lines 22607 20575 -2032
Branches 832 827 -5
==========================================
- Hits 19541 18182 -1359
+ Misses 3066 2393 -673
🚀 New features to boost your workflow:
|
1498c6e to
6abf54d
Compare
pm47
reviewed
Feb 10, 2026
eclair-core/src/main/scala/fr/acinq/eclair/payment/relay/ChannelRelay.scala
Outdated
Show resolved
Hide resolved
6abf54d to
654be15
Compare
When relaying payments, we want to select private channels first and keep as much liquidity available as possible in public channels, to ensure that we don't send a `channel_update` that would otherwise disable the public channel (and thus make the private channels also unusable since they aren't visible by path-finding algorithms) or limit the `htlc_maximum_msat` of this public channel (which also indirectly applies to private channels). We also change the order in which we select channels that have the same visibility: we prioritize channels with smaller balances, to ensure that we keep our larger balances for larger payments. When balances are equal, we prioritize the largest channel, which creates a larger inbound liquidity to allow receiving larger payments.
654be15 to
a070fdb
Compare
pm47
approved these changes
Feb 11, 2026
|
Question: Is this only between private payments between 2 acinq peers to go straight between them. Or for the broader Ln network? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When relaying payments, we want to select private channels first and keep as much liquidity available as possible in public channels, to ensure that we don't send a
channel_updatethat would otherwise disable the public channel (and thus make the private channels also unusable since they aren't visible by path-finding algorithms) or limit thehtlc_maximum_msatof this public channel (which also indirectly applies to private channels).