@@ -1768,6 +1768,19 @@ mod fuzzy_internal_msgs {
1768
1768
outgoing_cltv_value : u32 ,
1769
1769
/// The node id to which the trampoline node must find a route
1770
1770
outgoing_node_id : PublicKey ,
1771
+ } ,
1772
+ BlindedForward {
1773
+ encrypted_tlvs : Vec < u8 > ,
1774
+ intro_node_blinding_point : Option < PublicKey > ,
1775
+ } ,
1776
+ BlindedReceive {
1777
+ sender_intended_htlc_amt_msat : u64 ,
1778
+ total_msat : u64 ,
1779
+ cltv_expiry_height : u32 ,
1780
+ encrypted_tlvs : Vec < u8 > ,
1781
+ intro_node_blinding_point : Option < PublicKey > , // Set if the introduction node of the blinded path is the final node
1782
+ keysend_preimage : Option < PaymentPreimage > ,
1783
+ custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
1771
1784
}
1772
1785
}
1773
1786
@@ -2665,7 +2678,31 @@ impl Writeable for OutboundTrampolinePayload {
2665
2678
( 4 , HighZeroBytesDroppedBigSize ( * outgoing_cltv_value) , required) ,
2666
2679
( 14 , outgoing_node_id, required)
2667
2680
} ) ;
2668
- }
2681
+ } ,
2682
+ Self :: BlindedForward { encrypted_tlvs, intro_node_blinding_point } => {
2683
+ _encode_varint_length_prefixed_tlv ! ( w, {
2684
+ ( 10 , * encrypted_tlvs, required_vec) ,
2685
+ ( 12 , intro_node_blinding_point, option)
2686
+ } ) ;
2687
+ } ,
2688
+ Self :: BlindedReceive {
2689
+ sender_intended_htlc_amt_msat, total_msat, cltv_expiry_height, encrypted_tlvs,
2690
+ intro_node_blinding_point, keysend_preimage, ref custom_tlvs,
2691
+ } => {
2692
+ // We need to update [`ln::outbound_payment::RecipientOnionFields::with_custom_tlvs`]
2693
+ // to reject any reserved types in the experimental range if new ones are ever
2694
+ // standardized.
2695
+ let keysend_tlv = keysend_preimage. map ( |preimage| ( 5482373484 , preimage. encode ( ) ) ) ;
2696
+ let mut custom_tlvs: Vec < & ( u64 , Vec < u8 > ) > = custom_tlvs. iter ( ) . chain ( keysend_tlv. iter ( ) ) . collect ( ) ;
2697
+ custom_tlvs. sort_unstable_by_key ( |( typ, _) | * typ) ;
2698
+ _encode_varint_length_prefixed_tlv ! ( w, {
2699
+ ( 2 , HighZeroBytesDroppedBigSize ( * sender_intended_htlc_amt_msat) , required) ,
2700
+ ( 4 , HighZeroBytesDroppedBigSize ( * cltv_expiry_height) , required) ,
2701
+ ( 10 , * encrypted_tlvs, required_vec) ,
2702
+ ( 12 , intro_node_blinding_point, option) ,
2703
+ ( 18 , HighZeroBytesDroppedBigSize ( * total_msat) , required)
2704
+ } , custom_tlvs. iter( ) ) ;
2705
+ } ,
2669
2706
}
2670
2707
Ok ( ( ) )
2671
2708
}
0 commit comments