X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fblinded_path%2Fpayment.rs;h=39f16a91692cb30fb1be087191b4c32a506de830;hb=94e0ecec68d85ca1e10d08d6b35a9c9284c25ebb;hp=32181f7889c350fa3f23f2bdfe37a437d99808d4;hpb=f6a45056791b2dbbd0b41f581080d9884cda1e3a;p=rust-lightning diff --git a/lightning/src/blinded_path/payment.rs b/lightning/src/blinded_path/payment.rs index 32181f78..39f16a91 100644 --- a/lightning/src/blinded_path/payment.rs +++ b/lightning/src/blinded_path/payment.rs @@ -119,6 +119,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