Skip to content

Commit 69053ec

Browse files
f improve comments
1 parent 4c22614 commit 69053ec

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lightning/src/blinded_path/payment.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,21 @@ use crate::util::ser::{Readable, Writeable, Writer};
1515

1616
/// Data to construct a [`BlindedHop`] for forwarding a payment.
1717
pub struct ForwardTlvs {
18-
/// The short channel id this payment is being forwarded over.
18+
/// The short channel id this payment should be forwarded out over.
1919
short_channel_id: u64,
20-
/// Payment parameters for relaying over this channel.
20+
/// Payment parameters for relaying over [`Self::short_channel_id`].
2121
payment_relay: PaymentRelay,
22-
/// Payment constraints when relaying over this channel.
22+
/// Payment constraints for relaying over [`Self::short_channel_id`].
2323
payment_constraints: PaymentConstraints,
2424
/// Supported and required features when relaying a payment onion containing this object's
25-
/// corresponding [`BlindedHop`].
25+
/// corresponding [`BlindedHop::encrypted_payload`].
2626
///
27-
/// [`BlindedHop`]: crate::blinded_path::BlindedHop
27+
/// [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
2828
features: BlindedHopFeatures,
2929
}
3030

31-
/// Data to construct a [`BlindedHop`] for receiving a payment.
31+
/// Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
32+
/// may not be valid if received by another lightning implementation.
3233
pub struct ReceiveTlvs {
3334
/// Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
3435
payment_secret: PaymentSecret,
@@ -40,9 +41,9 @@ pub struct ReceiveTlvs {
4041
///
4142
/// [`BlindedHop`]: crate::blinded_path::BlindedHop
4243
pub(crate) enum BlindedPaymentTlvs {
43-
/// This blinded payment data is to be forwarded.
44+
/// This blinded payment data is for a forwarding node.
4445
Forward(ForwardTlvs),
45-
/// This blinded payment data is to be received.
46+
/// This blinded payment data is for the receiving node.
4647
Receive(ReceiveTlvs),
4748
}
4849

@@ -112,10 +113,10 @@ impl Readable for BlindedPaymentTlvs {
112113
_init_and_read_tlv_stream!(r, {
113114
(1, _padding, option),
114115
(2, scid, option),
115-
(6, payment_secret, option),
116116
(10, payment_relay, option),
117117
(12, payment_constraints, required),
118118
(14, features, option),
119+
(65536, payment_secret, option),
119120
});
120121
if let Some(short_channel_id) = scid {
121122
if payment_secret.is_some() { return Err(DecodeError::InvalidValue) }

0 commit comments

Comments
 (0)