Skip to content

LND sometimes sends a payment to a channel it got it from #2470

Closed

Description

@akumaigorodski

I'm testing self-payments and there is an edge case with the following setup:
A (phone) <- channel1 -> B (LND) <- channel2 -> A.

Sometimes payment may arrive via
A - channel1 -> B - channel1 -> A
even though a B - channel2 -> A route was proposed.

I know LN nodes are allowed to choose a different channel if they think it's a better fit, but looks like LND does not check that a channel it chooses may simultaneously be a channel it got a payment from?

The testnet peer is https://1ml.com/testnet/node/02ae2f22b02375e3e9b4b4a2db4f12e1b50752b4062dbefd6e01332acdaf680379

Activity

  1. cfromknecht commented on Jan 14, 2019

    @cfromknecht
    Contributor

    i don't see an issue necessarily with sending it back across the same channel, though I can see how this may add some unexpected behavior when trying to do rebalancing. should be straightforward to add a check to prefer other channels if multiple exist, and maybe only fall back to sending across the same channel if it's the only one with sufficient capacity?

  2. Roasbeef commented on Jan 15, 2019

    @Roasbeef
    Member

    This is documented as "non strict forwarding" in the specification, it's perfectly valid to do. If you're crafting manual routes, then we'll attempt to do nearly exactly what it dictates, this includes going back across channels if that's the way your path finding works.

  3. akumaigorodski commented on Jan 15, 2019

    @akumaigorodski
    Author

    In a specific case when peer sends a payment and immediately wants it back, but through another channel i'd say choosing the same channel accomplishes nothing but giving some free to routing node.

    Clearly peer wants to bounce a payment from one channel to another, perhaps it makes sense to have a rule that "source and sink channel can't be the same"?

  4. akumaigorodski commented on Jan 15, 2019

    @akumaigorodski
    Author

    On further consideration I think you are correct. There may be a different edge case like a service having a single channel with user paying to service itself from user's account at that service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions