X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fblinded_path%2Fpayment.rs;h=4edfb7d8de05bf0e0187941cc91bf4f646fe5557;hb=1926c82b9ee570b3647cb832243e3e6f86d6fa2c;hp=32181f7889c350fa3f23f2bdfe37a437d99808d4;hpb=f3616e606ffd76b1769638c910e8db2234bbf5ff;p=rust-lightning diff --git a/lightning/src/blinded_path/payment.rs b/lightning/src/blinded_path/payment.rs index 32181f78..4edfb7d8 100644 --- a/lightning/src/blinded_path/payment.rs +++ b/lightning/src/blinded_path/payment.rs @@ -89,8 +89,7 @@ pub struct PaymentRelay { /// [`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`]. @@ -119,6 +118,21 @@ impl Writeable for ReceiveTlvs { } } +// 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: &mut R) -> Result { + _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(&self, w: &mut W) -> Result<(), io::Error> { // TODO: write padding