Skip to content

Commit 32d8084

Browse files
f remove BlindedPamentTlvs::Receive::features
1 parent 1ba6c5a commit 32d8084

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

lightning/src/blinded_path/payment.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ pub enum BlindedPaymentTlvs {
3737
payment_secret: PaymentSecret,
3838
/// Constraints for the receiver of this payment.
3939
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,
4540
},
4641
}
4742

@@ -89,11 +84,10 @@ impl Writeable for BlindedPaymentTlvs {
8984
(14, features, required),
9085
});
9186
},
92-
Self::Receive { payment_secret, payment_constraints, features } => {
87+
Self::Receive { payment_secret, payment_constraints } => {
9388
encode_tlv_stream!(w, {
9489
(6, payment_secret, required),
9590
(12, payment_constraints, required),
96-
(14, features, required),
9791
});
9892
}
9993
}
@@ -109,22 +103,21 @@ impl Readable for BlindedPaymentTlvs {
109103
(6, payment_secret, option),
110104
(10, payment_relay, option),
111105
(12, payment_constraints, required),
112-
(14, features, required),
106+
(14, features, option),
113107
});
114108
if let Some(short_channel_id) = scid {
115109
if payment_secret.is_some() { return Err(DecodeError::InvalidValue) }
116110
Ok(BlindedPaymentTlvs::Forward {
117111
short_channel_id,
118112
payment_relay: payment_relay.ok_or(DecodeError::InvalidValue)?,
119113
payment_constraints: payment_constraints.0.unwrap(),
120-
features: features.0.unwrap(),
114+
features: features.ok_or(DecodeError::InvalidValue)?,
121115
})
122116
} else {
123-
if payment_relay.is_some() { return Err(DecodeError::InvalidValue) }
117+
if payment_relay.is_some() | features.is_some() { return Err(DecodeError::InvalidValue) }
124118
Ok(BlindedPaymentTlvs::Receive {
125119
payment_secret: payment_secret.ok_or(DecodeError::InvalidValue)?,
126120
payment_constraints: payment_constraints.0.unwrap(),
127-
features: features.0.unwrap(),
128121
})
129122
}
130123
}

0 commit comments

Comments
 (0)