Relay payments to preferred channels#648
Merged
Merged
Conversation
In order to reduce unnecessary back-and-forth in case an outgoing channel doesn't have enough capacity but another one has, the relayer can now forward a payment to a different channel that the one specified in the onion (to the same node of course). As a side effect, if this preferred channel returns an error, then the sender will have an error for a different channel than the one it selected. Note that eclair already supports that (see PaymentLifecycle).
Added a new channel event `AvailableBalanceChanged` in an attempt to simplify: this event provides a `ShortChannelId` and allows to get rid of the long channel id in the relayer maps.
sstone
reviewed
Jul 9, 2018
|
|
||
| case LocalChannelUpdate(_, channelId, shortChannelId, remoteNodeId, _, channelUpdate, commitments) => | ||
| log.debug(s"updating local channel info for channelId=$channelId shortChannelId=$shortChannelId remoteNodeId=$remoteNodeId channelUpdate={} commitments={}", channelUpdate, commitments) | ||
| val availableLocalBalance = commitments.remoteCommit.spec.toRemoteMsat |
Member
There was a problem hiding this comment.
nitpick: there should be a comment here on why we use the to_remote field in our view of their remote tx
sstone
previously approved these changes
Jul 9, 2018
sstone
approved these changes
Jul 9, 2018
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.
In order to reduce unnecessary back-and-forth in case an outgoing
channel doesn't have enough capacity but another one has, the relayer
can now forward a payment to a different channel that the one specified
in the onion (to the same node of course).