Fix: Payouts were incorrectly marked as canceled even after successful completion #6365
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug fix
Payouts were incorrectly marked as canceled even after successful completion on some Lightning implementations (NwC/Nostr and Blink).
Explanation
Following a refactoring of Payout in 2.0, the automated Lightning payout processor would pay the BOLT11 invoice and then request the payment data via the
LightningClient
.However, retrieving payment data could fail in certain cases. For Nostr, this occurred when a timeout happened (for example, if the connection to relays is hanging).
For Blink, it failed if the recipient was also using a Blink wallet, as the pre-image wasn't accessible through the API.
This PR ensures that a failed call to
GetPayment
will no longer result in the payout being marked as canceled after a successful payment.