lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.65k stars 2.07k forks source link

Async payment cancellation #4562

Open halseth opened 4 years ago

halseth commented 4 years ago

Related to https://github.com/lightningnetwork/lnd/issues/4518

After we made the payment lifecycle reliable (https://github.com/lightningnetwork/lnd/pull/2761) a natural follow-up was to introduce a cancel payment API for payments. This would let a payment be attempted with a very high payment timeout, and pathfinding would run in the background until canceled, failure or success.

What needs to be done is to signal the payment lifecycle that the payment should be canceled, and handle this signal here with a new failure reason (could also reuse the timeout one): https://github.com/lightningnetwork/lnd/blob/cc37485432741194c7f59320d4807af03d9e4698/routing/payment_lifecycle.go#L189

yyforyongyu commented 10 months ago

Bumping this issue as this can be helpful to fix the stuck payment issue.