Skip to content

Conversation

valentinewallace
Copy link
Contributor

Previously, we had a bug that particularly affected async payments where if an outbound payment was in the state {Static}InvoiceReceived and there was a call to process_pending_htlc_forwards, the payment would be automatically abandoned. We would behave correctly and avoid abandoning if the payment was awaiting an invoice, but not if the payment had an invoice but the HTLCs weren't yet locked in.

Previously, we had a bug that particularly affected async payments where if an
outbound payment was in the state {Static}InvoiceReceived and there was a call
to process_pending_htlc_forwards, the payment would be automatically abandoned.
We would behave correctly and avoid abandoning if the payment was awaiting an
invoice, but not if the payment had an invoice but the HTLCs weren't yet locked
in.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Sep 17, 2025

👋 Thanks for assigning @joostjager as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Copy link

codecov bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.64%. Comparing base (c71334e) to head (ebb8e79).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/outbound_payment.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4078      +/-   ##
==========================================
+ Coverage   88.63%   88.64%   +0.01%     
==========================================
  Files         176      176              
  Lines      131920   131922       +2     
  Branches   131920   131922       +2     
==========================================
+ Hits       116927   116948      +21     
+ Misses      12325    12311      -14     
+ Partials     2668     2663       -5     
Flag Coverage Δ
fuzzing 21.60% <0.00%> (ø)
tests 88.48% <83.33%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

match self {
PendingOutboundPayment::AwaitingInvoice { .. } => true,
PendingOutboundPayment::AwaitingInvoice { .. }
| PendingOutboundPayment::InvoiceReceived { .. }
Copy link
Contributor

@joostjager joostjager Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First I thought InvoiceReceived isn't necessary, because the payment is initiated immediately after receiving the invoice. But on a closer look, I think there are also similar gaps that require this check. There is also manual bolt12 invoice payment. No test coverage though I think.

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Tagging for backporting.

@tnull tnull merged commit b002e43 into lightningdevkit:main Sep 18, 2025
25 checks passed
@TheBlueMatt
Copy link
Collaborator

Backported in #4143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants