@@ -37,11 +37,6 @@ pub enum BlindedPaymentTlvs {
37
37
payment_secret : PaymentSecret ,
38
38
/// Constraints for the receiver of this payment.
39
39
payment_constraints : PaymentConstraints ,
40
- /// Supported and required features when receiving a payment containing this object's
41
- /// corresponding [`BlindedHop`].
42
- ///
43
- /// [`BlindedHop`]: crate::blinded_path::BlindedHop
44
- features : BlindedHopFeatures ,
45
40
} ,
46
41
}
47
42
@@ -89,11 +84,10 @@ impl Writeable for BlindedPaymentTlvs {
89
84
( 14 , features, required) ,
90
85
} ) ;
91
86
} ,
92
- Self :: Receive { payment_secret, payment_constraints, features } => {
87
+ Self :: Receive { payment_secret, payment_constraints } => {
93
88
encode_tlv_stream ! ( w, {
94
89
( 6 , payment_secret, required) ,
95
90
( 12 , payment_constraints, required) ,
96
- ( 14 , features, required) ,
97
91
} ) ;
98
92
}
99
93
}
@@ -109,22 +103,21 @@ impl Readable for BlindedPaymentTlvs {
109
103
( 6 , payment_secret, option) ,
110
104
( 10 , payment_relay, option) ,
111
105
( 12 , payment_constraints, required) ,
112
- ( 14 , features, required ) ,
106
+ ( 14 , features, option ) ,
113
107
} ) ;
114
108
if let Some ( short_channel_id) = scid {
115
109
if payment_secret. is_some ( ) { return Err ( DecodeError :: InvalidValue ) }
116
110
Ok ( BlindedPaymentTlvs :: Forward {
117
111
short_channel_id,
118
112
payment_relay : payment_relay. ok_or ( DecodeError :: InvalidValue ) ?,
119
113
payment_constraints : payment_constraints. 0 . unwrap ( ) ,
120
- features : features. 0 . unwrap ( ) ,
114
+ features : features. ok_or ( DecodeError :: InvalidValue ) ? ,
121
115
} )
122
116
} else {
123
- if payment_relay. is_some ( ) { return Err ( DecodeError :: InvalidValue ) }
117
+ if payment_relay. is_some ( ) | features . is_some ( ) { return Err ( DecodeError :: InvalidValue ) }
124
118
Ok ( BlindedPaymentTlvs :: Receive {
125
119
payment_secret : payment_secret. ok_or ( DecodeError :: InvalidValue ) ?,
126
120
payment_constraints : payment_constraints. 0 . unwrap ( ) ,
127
- features : features. 0 . unwrap ( ) ,
128
121
} )
129
122
}
130
123
}
0 commit comments