Background
QueryRoutes/pathfinding can produce self-payment routes that use the same
channel twice, for example:
where both hops use the same SCID in opposite directions. This falls out of the
existing source == target special case in pathfinding: self-payments/rebalances
must be allowed to return to the source, but the shortest return path may be the
same channel.
Scope clarification
After looking closer, this appears to be a narrow 2-hop self-route problem rather
than a general cleartext pathfinding problem.
For normal non-self routes, reusing a channel would require revisiting one of the
channel endpoints, so the existing node-cycle avoidance should already prevent
that. Longer self-route loops that repeat an intermediate node should be covered
by the same mechanism.
The problematic cleartext case is:
where the only repeated node is the source/target itself, which pathfinding
intentionally allows for self-payments.
For rebalancing, this route shape appears useless because it does not move
liquidity between distinct local channels. It can still lock liquidity, incur
fees, or fail later at forwarding time.
Background
QueryRoutes/pathfinding can produce self-payment routes that use the samechannel twice, for example:
where both hops use the same SCID in opposite directions. This falls out of the
existing
source == targetspecial case in pathfinding: self-payments/rebalancesmust be allowed to return to the source, but the shortest return path may be the
same channel.
Scope clarification
After looking closer, this appears to be a narrow 2-hop self-route problem rather
than a general cleartext pathfinding problem.
For normal non-self routes, reusing a channel would require revisiting one of the
channel endpoints, so the existing node-cycle avoidance should already prevent
that. Longer self-route loops that repeat an intermediate node should be covered
by the same mechanism.
The problematic cleartext case is:
where the only repeated node is the source/target itself, which pathfinding
intentionally allows for self-payments.
For rebalancing, this route shape appears useless because it does not move
liquidity between distinct local channels. It can still lock liquidity, incur
fees, or fail later at forwarding time.