@@ -15,20 +15,21 @@ use crate::util::ser::{Readable, Writeable, Writer};
15
15
16
16
/// Data to construct a [`BlindedHop`] for forwarding a payment.
17
17
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.
19
19
short_channel_id : u64 ,
20
- /// Payment parameters for relaying over this channel .
20
+ /// Payment parameters for relaying over [`Self::short_channel_id`] .
21
21
payment_relay : PaymentRelay ,
22
- /// Payment constraints when relaying over this channel .
22
+ /// Payment constraints for relaying over [`Self::short_channel_id`] .
23
23
payment_constraints : PaymentConstraints ,
24
24
/// Supported and required features when relaying a payment onion containing this object's
25
- /// corresponding [`BlindedHop`].
25
+ /// corresponding [`BlindedHop::encrypted_payload `].
26
26
///
27
- /// [`BlindedHop`]: crate::blinded_path::BlindedHop
27
+ /// [`BlindedHop::encrypted_payload `]: crate::blinded_path::BlindedHop::encrypted_payload
28
28
features : BlindedHopFeatures ,
29
29
}
30
30
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.
32
33
pub struct ReceiveTlvs {
33
34
/// Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
34
35
payment_secret : PaymentSecret ,
@@ -40,9 +41,9 @@ pub struct ReceiveTlvs {
40
41
///
41
42
/// [`BlindedHop`]: crate::blinded_path::BlindedHop
42
43
pub ( crate ) enum BlindedPaymentTlvs {
43
- /// This blinded payment data is to be forwarded .
44
+ /// This blinded payment data is for a forwarding node .
44
45
Forward ( ForwardTlvs ) ,
45
- /// This blinded payment data is to be received .
46
+ /// This blinded payment data is for the receiving node .
46
47
Receive ( ReceiveTlvs ) ,
47
48
}
48
49
@@ -112,10 +113,10 @@ impl Readable for BlindedPaymentTlvs {
112
113
_init_and_read_tlv_stream ! ( r, {
113
114
( 1 , _padding, option) ,
114
115
( 2 , scid, option) ,
115
- ( 6 , payment_secret, option) ,
116
116
( 10 , payment_relay, option) ,
117
117
( 12 , payment_constraints, required) ,
118
118
( 14 , features, option) ,
119
+ ( 65536 , payment_secret, option) ,
119
120
} ) ;
120
121
if let Some ( short_channel_id) = scid {
121
122
if payment_secret. is_some ( ) { return Err ( DecodeError :: InvalidValue ) }
0 commit comments