X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fmsgs.rs;h=8bb264fe9c6332a9950bda2045a27faf35ab553c;hb=7b1e09134afd256aa3a5465b51cac90bf9e2ab00;hp=6bd5ec3f7293fcac5c043bf3437e47eb90127d9d;hpb=81f4151001d734597de57809fab66c300478fcb6;p=rust-lightning diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index 6bd5ec3f..8bb264fe 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -1517,6 +1517,7 @@ pub trait OnionMessageHandler : OnionMessageProvider { } mod fuzzy_internal_msgs { + use bitcoin::secp256k1::PublicKey; use crate::prelude::*; use crate::ln::{PaymentPreimage, PaymentSecret}; @@ -1562,6 +1563,17 @@ mod fuzzy_internal_msgs { amt_msat: u64, outgoing_cltv_value: u32, }, + BlindedForward { + encrypted_tlvs: Vec, + intro_node_blinding_point: Option, + }, + BlindedReceive { + amt_msat: u64, + total_msat: u64, + outgoing_cltv_value: u32, + encrypted_tlvs: Vec, + intro_node_blinding_point: Option, // Set if the introduction node of the blinded path is the final node + } } pub struct DecodedOnionErrorPacket { @@ -2097,6 +2109,24 @@ impl Writeable for OutboundOnionPayload { (16, payment_metadata.as_ref().map(|m| WithoutLength(m)), option) }, custom_tlvs.iter()); }, + Self::BlindedForward { encrypted_tlvs, intro_node_blinding_point } => { + _encode_varint_length_prefixed_tlv!(w, { + (10, *encrypted_tlvs, required_vec), + (12, intro_node_blinding_point, option) + }); + }, + Self::BlindedReceive { + amt_msat, total_msat, outgoing_cltv_value, encrypted_tlvs, + intro_node_blinding_point, + } => { + _encode_varint_length_prefixed_tlv!(w, { + (2, HighZeroBytesDroppedBigSize(*amt_msat), required), + (4, HighZeroBytesDroppedBigSize(*outgoing_cltv_value), required), + (10, *encrypted_tlvs, required_vec), + (12, intro_node_blinding_point, option), + (18, HighZeroBytesDroppedBigSize(*total_msat), required) + }); + }, } Ok(()) }