/// [`BlindedHop`]: crate::blinded_path::BlindedHop
#[derive(Clone, Debug)]
pub struct PaymentConstraints {
- /// The maximum total CLTV delta that is acceptable when relaying a payment over this
- /// [`BlindedHop`].
+ /// The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
pub max_cltv_expiry: u32,
/// The minimum value, in msat, that may be accepted by the node corresponding to this
/// [`BlindedHop`].
}
}
+// This will be removed once we support forwarding blinded HTLCs, because we'll always read a
+// `BlindedPaymentTlvs` instead.
+impl Readable for ReceiveTlvs {
+ fn read<R: io::Read>(r: &mut R) -> Result<Self, DecodeError> {
+ _init_and_read_tlv_stream!(r, {
+ (12, payment_constraints, required),
+ (65536, payment_secret, required),
+ });
+ Ok(Self {
+ payment_secret: payment_secret.0.unwrap(),
+ payment_constraints: payment_constraints.0.unwrap()
+ })
+ }
+}
+
impl<'a> Writeable for BlindedPaymentTlvsRef<'a> {
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
// TODO: write padding