@@ -1830,7 +1830,7 @@ mod fuzzy_internal_msgs {
1830
1830
}
1831
1831
}
1832
1832
1833
- pub ( crate ) enum OutboundTrampolinePayload {
1833
+ pub ( crate ) enum OutboundTrampolinePayload < ' a > {
1834
1834
#[ allow( unused) ]
1835
1835
Forward {
1836
1836
/// The value, in msat, of the payment after this hop's fee is deducted.
@@ -1851,6 +1851,21 @@ mod fuzzy_internal_msgs {
1851
1851
/// If applicable, features of the BOLT12 invoice being paid.
1852
1852
invoice_features : Option < Bolt12InvoiceFeatures > ,
1853
1853
} ,
1854
+ #[ allow( unused) ]
1855
+ BlindedForward {
1856
+ encrypted_tlvs : & ' a Vec < u8 > ,
1857
+ intro_node_blinding_point : Option < PublicKey > ,
1858
+ } ,
1859
+ #[ allow( unused) ]
1860
+ BlindedReceive {
1861
+ sender_intended_htlc_amt_msat : u64 ,
1862
+ total_msat : u64 ,
1863
+ cltv_expiry_height : u32 ,
1864
+ encrypted_tlvs : & ' a Vec < u8 > ,
1865
+ intro_node_blinding_point : Option < PublicKey > , // Set if the introduction node of the blinded path is the final node
1866
+ keysend_preimage : Option < PaymentPreimage > ,
1867
+ custom_tlvs : & ' a Vec < ( u64 , Vec < u8 > ) > ,
1868
+ }
1854
1869
}
1855
1870
1856
1871
pub struct DecodedOnionErrorPacket {
@@ -2766,7 +2781,7 @@ impl<'a> Writeable for OutboundOnionPayload<'a> {
2766
2781
}
2767
2782
}
2768
2783
2769
- impl Writeable for OutboundTrampolinePayload {
2784
+ impl < ' a > Writeable for OutboundTrampolinePayload < ' a > {
2770
2785
fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , io:: Error > {
2771
2786
match self {
2772
2787
Self :: Forward { amt_to_forward, outgoing_cltv_value, outgoing_node_id } => {
@@ -2794,6 +2809,22 @@ impl Writeable for OutboundTrampolinePayload {
2794
2809
( 22 , WithoutLength ( blinded_path_serialization) , required)
2795
2810
} ) ;
2796
2811
} ,
2812
+ Self :: BlindedForward { encrypted_tlvs, intro_node_blinding_point} => {
2813
+ _encode_varint_length_prefixed_tlv ! ( w, {
2814
+ ( 10 , * * encrypted_tlvs, required_vec) ,
2815
+ ( 12 , intro_node_blinding_point, option)
2816
+ } ) ;
2817
+ } ,
2818
+ Self :: BlindedReceive { sender_intended_htlc_amt_msat, total_msat, cltv_expiry_height, encrypted_tlvs, intro_node_blinding_point, keysend_preimage, custom_tlvs } => {
2819
+ _encode_varint_length_prefixed_tlv ! ( w, {
2820
+ ( 2 , HighZeroBytesDroppedBigSize ( * sender_intended_htlc_amt_msat) , required) ,
2821
+ ( 4 , HighZeroBytesDroppedBigSize ( * cltv_expiry_height) , required) ,
2822
+ ( 10 , * * encrypted_tlvs, required_vec) ,
2823
+ ( 12 , intro_node_blinding_point, option) ,
2824
+ ( 18 , HighZeroBytesDroppedBigSize ( * total_msat) , required) ,
2825
+ ( 20 , keysend_preimage, option)
2826
+ } , custom_tlvs. iter( ) ) ;
2827
+ }
2797
2828
}
2798
2829
Ok ( ( ) )
2799
2830
}
0 commit comments