Skip to content

Relay payments to preferred channels#648

Merged
pm47 merged 7 commits into
masterfrom
preferred-channels
Jul 9, 2018
Merged

Relay payments to preferred channels#648
pm47 merged 7 commits into
masterfrom
preferred-channels

Conversation

@pm47
Copy link
Copy Markdown
Member

@pm47 pm47 commented Jun 27, 2018

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).

pm47 added 5 commits June 19, 2018 19:27
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.
@pm47 pm47 force-pushed the preferred-channels branch from 8672f36 to 9aca85d Compare July 2, 2018 16:04
@pm47 pm47 changed the title [WIP] Relay payments to preferred channels Relay payments to preferred channels Jul 2, 2018
@pm47 pm47 requested a review from sstone July 2, 2018 16:26

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: there should be a comment here on why we use the to_remote field in our view of their remote tx

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

sstone
sstone previously approved these changes Jul 9, 2018
@pm47 pm47 merged commit 5ea623a into master Jul 9, 2018
@pm47 pm47 deleted the preferred-channels branch July 9, 2018 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants