Skip to content

Expose payment failure reason on PaymentFailed event - #263

Merged
benthecarman merged 1 commit into
lightningdevkit:mainfrom
elnafateh:expose-payment-failure-reason
Aug 29, 2026
Merged

Expose payment failure reason on PaymentFailed event#263
benthecarman merged 1 commit into
lightningdevkit:mainfrom
elnafateh:expose-payment-failure-reason

Conversation

@elnafateh

Copy link
Copy Markdown
Contributor

Closes part of #251.

PaymentFailed currently drops the reason field that LDK Node already provides. This adds it as an optional PaymentFailureReason enum on the proto event, mapped 1:1 from lightning::events::PaymentFailureReason.

  • New PaymentFailureReason enum in events.proto, mirrors LDK's variants
  • payment_failure_reason_to_proto() mapping function, wired into the event handler
  • Unit test covering all 10 variants
  • E2e test updated to assert reason is populated

The other items in #251 (splice events, channel snapshot fields, on-chain tx classification, misc fields) are left for follow-up PRs.

@ldk-reviews-bot

ldk-reviews-bot commented Aug 28, 2026

Copy link
Copy Markdown

👋 Thanks for assigning @benthecarman 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.

Comment thread ldk-server/src/main.rs Outdated
Comment thread e2e-tests/tests/e2e.rs Outdated
Comment thread e2e-tests/tests/e2e.rs Outdated
@elnafateh
elnafateh requested a review from benthecarman August 28, 2026 10:59
@benthecarman

Copy link
Copy Markdown
Collaborator

Please squash your commits

@elnafateh
elnafateh force-pushed the expose-payment-failure-reason branch from 610e574 to 988759c Compare August 28, 2026 22:36
@elnafateh

Copy link
Copy Markdown
Contributor Author

Please squash your commits

it's done

@benthecarman benthecarman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can you remove the link to the issue in the commit message, it causes spam in github, otherwise looks good to me

@elnafateh

Copy link
Copy Markdown
Contributor Author

can you remove the link to the issue in the commit message, it causes spam in github, otherwise looks good to me

ok

Adds PaymentFailureReason to the PaymentFailed proto event, mapped
from ldk-node's lightning::events::PaymentFailureReason.
@elnafateh
elnafateh force-pushed the expose-payment-failure-reason branch from 988759c to 46228c2 Compare August 28, 2026 22:44
@elnafateh

Copy link
Copy Markdown
Contributor Author

can you remove the link to the issue in the commit message, it causes spam in github, otherwise looks good to me

ok

it's been dropped

@benthecarman
benthecarman merged commit 2261d68 into lightningdevkit:main Aug 29, 2026
11 checks passed
@elnafateh
elnafateh deleted the expose-payment-failure-reason branch August 29, 2026 20:15
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.

3 participants