Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: change PaymentPreimage to PaymentSecret in ChannelManager::create_inbound_payment #2846

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7832,7 +7832,7 @@ where
/// to pay us.
///
/// This differs from [`create_inbound_payment_for_hash`] only in that it generates the
/// [`PaymentHash`] and [`PaymentPreimage`] for you.
/// [`PaymentHash`] and [`PaymentSecret`] for you.
Comment on lines 7834 to +7835
Copy link
Contributor

Choose a reason for hiding this comment

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

The docs are correct as is. This isn't saying that the PaymentPreimage is returned but rather it is generated in LDK. It's essentially encoded in the PaymentSecret such that inbound payments in LDK are stateless when using create_inbound_payment.

Using create_inbound_payment_for_hash allows you to generated your own preimage, but you would need to track it in order to call claim_funds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will close this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Any suggestions on how to improve these docs for clarity are welcome, of course!

///
/// The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
/// will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
Expand Down