You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LND sometimes sends a payment to a channel it got it from #2470
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?
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?
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.
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"?
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.
Activity
cfromknecht commentedon Jan 14, 2019
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?
Roasbeef commentedon Jan 15, 2019
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.
akumaigorodski commentedon Jan 15, 2019
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"?
akumaigorodski commentedon Jan 15, 2019
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.