Skip to content

Conversation

@shruti2522
Copy link

fix #2462

  • implemented the following in outbound_payment.rs :

    • if the router tells us the payment is to ourselves, we build a simple one-hop route and treat it like a local payment
    • when preimage is available, immediately claim the HTLC
  • added test case self_spontaneous_payment_fulfills() to test self payment

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jan 20, 2026

👋 I see @valentinewallace was un-assigned.
If you'd like another reviewer assignment, please click here.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

This violates a number of the API constraints on sending payments - specifically, someone could send a payment, then restart and they wouldn't see the pending payment, thinking they hadn't "sent" it. Check out some of the early feedback on the first attempt at this #2573

@TheBlueMatt TheBlueMatt removed the request for review from valentinewallace January 20, 2026 21:51
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 95.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.54%. Comparing base (e9ce486) to head (845b3ab).

Files with missing lines Patch % Lines
lightning/src/ln/outbound_payment.rs 95.71% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4328      +/-   ##
==========================================
- Coverage   86.54%   86.54%   -0.01%     
==========================================
  Files         158      158              
  Lines      103166   103232      +66     
  Branches   103166   103232      +66     
==========================================
+ Hits        89287    89338      +51     
- Misses      11456    11469      +13     
- Partials     2423     2425       +2     
Flag Coverage Δ
fuzzing 37.03% <34.88%> (-0.04%) ⬇️
tests 85.83% <95.71%> (-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.

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.

Allow self-payment

3 participants