]> git.bitcoin.ninja Git - rust-lightning/commit
Implement non-strict forwarding
authorWillem Van Lint <noreply@wvanlint.dev>
Tue, 11 Jun 2024 23:05:57 +0000 (16:05 -0700)
committerWillem Van Lint <noreply@wvanlint.dev>
Thu, 20 Jun 2024 04:24:21 +0000 (21:24 -0700)
commit05e6252b20ac3a3412d4da38f732191724f30bc0
tree327a2415f17d925eed91bea44a33d42e32bbce6a
parent07f33800a163ba867a8ac8d22130e8f7058b96ed
Implement non-strict forwarding

This change implements non-strict forwarding, allowing the node to
forward an HTLC along a channel other than the one specified
by short_channel_id in the onion message, so long as the receiver has
the same node public key intended by short_channel_id
([BOLT](https://github.com/lightning/bolts/blob/57ce4b1e05c996fa649f00dc13521f6d496a288f/04-onion-routing.md#non-strict-forwarding)).
This can improve payment reliability when there are multiple channels
with the same peer e.g. when outbound liquidity is replenished by
opening a new channel.

The implemented forwarding strategy now chooses the channel with the
lowest outbound liquidity that can forward an HTLC to maximize the
probability of being able to successfully forward a subsequent HTLC.

Fixes #1278.
fuzz/src/full_stack.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/payment_tests.rs