rust-lightning/lightning/src
Matt Corallo f76f60ff85 Mark failed counterparty-is-destination HTLCs retryable
When our counterparty is the payment destination and we receive
an `HTLCFailReason::Reason` in `fail_htlc_backwards_internal` we
currently always set `rejected_by_dest` in the `PaymentPathFailed`
event, implying the HTLC should *not* be retried.

There are a number of cases where we use `HTLCFailReason::Reason`,
but most should reasonably be treated as retryable even if our
counterparty was the destination (i.e. `!rejected_by_dest`):
 * If an HTLC times out on-chain, this doesn't imply that the
   payment is no longer retryable, though the peer may well be
   offline so retrying may not be very useful,
 * If a commitment transaction "containing" a dust HTLC is
   confirmed on-chain, this definitely does not imply the payment
   is no longer retryable
 * If the channel we intended to relay over was closed (or
   force-closed) we should retry over another path,
 * If the channel we intended to relay over did not have enough
   capacity we should retry over another path,
 * If we received a update_fail_malformed_htlc message from our
   peer, we likely should *not* retry, however this should be
   exceedingly rare, and appears to nearly never appear in practice

Thus, this commit simply disables the behavior here, opting to
treat all `HTLCFailReason::Reason` errors as retryable.

Note that prior to 93e645daf4 this
change would not have made sense as it would have resulted in us
retrying the payment over the same channel in some cases, however
we now "blame" our own channel and will avoid it when routing for
the same payment.
2022-09-07 20:43:17 +00:00
..
chain Correct payment resolution after on chain failure of dust HTLCs 2022-09-06 20:23:18 +00:00
ln Mark failed counterparty-is-destination HTLCs retryable 2022-09-07 20:43:17 +00:00
onion_message Limit OnionMessenger outbound buffer size 2022-09-02 16:35:35 -04:00
routing Keep track of inflight HTLCs across payments 2022-08-31 18:50:02 -07:00
util Merge pull request #1657 from TheBlueMatt/2022-08-async-man-update 2022-09-06 16:06:06 -04:00
debug_sync.rs Fix new compilation warnings in debug_sync module 2022-07-26 20:29:36 +00:00
lib.rs Expose onion message module as public 2022-09-02 16:25:32 -04:00
sync.rs Create a simple FairRwLock to avoid readers starving writers 2022-05-10 23:40:20 +00:00