@@ -30,7 +30,7 @@ use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
3030use crate :: offers:: invoice:: Bolt12Invoice ;
3131use crate :: onion_message:: messenger:: Responder ;
3232use crate :: routing:: gossip:: NetworkUpdate ;
33- use crate :: routing:: router:: { BlindedTail , Path , RouteHop , RouteParameters } ;
33+ use crate :: routing:: router:: { BlindedTail , Path , RouteHop , RouteParameters , TrampolineHop } ;
3434use crate :: sign:: SpendableOutputDescriptor ;
3535use crate :: util:: errors:: APIError ;
3636use crate :: util:: ser:: { BigSize , FixedLengthReader , Writeable , Writer , MaybeReadable , Readable , RequiredWrapper , UpgradableRequired , WithoutLength } ;
@@ -1190,12 +1190,12 @@ pub enum Event {
11901190 /// events generated or serialized by versions prior to 0.0.122.
11911191 next_user_channel_id : Option < u128 > ,
11921192 /// The node id of the previous node.
1193- ///
1193+ ///
11941194 /// This is only `None` for HTLCs received prior to 0.1 or for events serialized by
11951195 /// versions prior to 0.1
11961196 prev_node_id : Option < PublicKey > ,
11971197 /// The node id of the next node.
1198- ///
1198+ ///
11991199 /// This is only `None` for HTLCs received prior to 0.1 or for events serialized by
12001200 /// versions prior to 0.1
12011201 next_node_id : Option < PublicKey > ,
@@ -1574,6 +1574,7 @@ impl Writeable for Event {
15741574 ( 2 , payment_failed_permanently, required) ,
15751575 ( 3 , false , required) , // all_paths_failed in LDK versions prior to 0.0.114
15761576 ( 4 , path. blinded_tail, option) ,
1577+ ( 6 , path. trampoline_hops, optional_vec) ,
15771578 ( 5 , path. hops, required_vec) ,
15781579 ( 7 , short_channel_id, option) ,
15791580 ( 9 , None :: <RouteParameters >, option) , // retry in LDK versions prior to 0.0.115
@@ -1665,6 +1666,7 @@ impl Writeable for Event {
16651666 ( 2 , payment_hash, option) ,
16661667 ( 4 , path. hops, required_vec) ,
16671668 ( 6 , path. blinded_tail, option) ,
1669+ ( 8 , path. trampoline_hops, optional_vec) ,
16681670 } )
16691671 } ,
16701672 & Event :: PaymentFailed { ref payment_id, ref payment_hash, ref reason } => {
@@ -1729,6 +1731,7 @@ impl Writeable for Event {
17291731 ( 2 , payment_hash, required) ,
17301732 ( 4 , path. hops, required_vec) ,
17311733 ( 6 , path. blinded_tail, option) ,
1734+ ( 8 , path. trampoline_hops, optional_vec) ,
17321735 } )
17331736 } ,
17341737 & Event :: ProbeFailed { ref payment_id, ref payment_hash, ref path, ref short_channel_id } => {
@@ -1739,6 +1742,7 @@ impl Writeable for Event {
17391742 ( 4 , path. hops, required_vec) ,
17401743 ( 6 , short_channel_id, option) ,
17411744 ( 8 , path. blinded_tail, option) ,
1745+ ( 10 , path. trampoline_hops, optional_vec)
17421746 } )
17431747 } ,
17441748 & Event :: HTLCHandlingFailed { ref prev_channel_id, ref failed_next_destination } => {
@@ -1915,6 +1919,7 @@ impl MaybeReadable for Event {
19151919 let mut network_update = None ;
19161920 let mut blinded_tail: Option < BlindedTail > = None ;
19171921 let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1922+ let mut trampoline_path: Option < Vec < TrampolineHop > > = Some ( vec ! [ ] ) ;
19181923 let mut short_channel_id = None ;
19191924 let mut payment_id = None ;
19201925 let mut failure_opt = None ;
@@ -1923,6 +1928,7 @@ impl MaybeReadable for Event {
19231928 ( 1 , network_update, upgradable_option) ,
19241929 ( 2 , payment_failed_permanently, required) ,
19251930 ( 4 , blinded_tail, option) ,
1931+ ( 6 , trampoline_path, optional_vec) ,
19261932 // Added as a part of LDK 0.0.101 and always filled in since.
19271933 // Defaults to an empty Vec, though likely should have been `Option`al.
19281934 ( 5 , path, optional_vec) ,
@@ -1936,7 +1942,7 @@ impl MaybeReadable for Event {
19361942 payment_hash,
19371943 payment_failed_permanently,
19381944 failure,
1939- path : Path { hops : path. unwrap ( ) , blinded_tail } ,
1945+ path : Path { hops : path. unwrap ( ) , trampoline_hops : trampoline_path . unwrap_or ( vec ! [ ] ) , blinded_tail } ,
19401946 short_channel_id,
19411947 #[ cfg( test) ]
19421948 error_code,
@@ -2077,11 +2083,12 @@ impl MaybeReadable for Event {
20772083 ( 2 , payment_hash, option) ,
20782084 ( 4 , path, required_vec) ,
20792085 ( 6 , blinded_tail, option) ,
2086+ ( 8 , trampoline_path, optional_vec) ,
20802087 } ) ;
20812088 Ok ( Some ( Event :: PaymentPathSuccessful {
20822089 payment_id : payment_id. 0 . unwrap ( ) ,
20832090 payment_hash,
2084- path : Path { hops : path, blinded_tail } ,
2091+ path : Path { hops : path, trampoline_hops : trampoline_path . unwrap_or ( vec ! [ ] ) , blinded_tail } ,
20852092 } ) )
20862093 } ;
20872094 f ( )
@@ -2157,11 +2164,12 @@ impl MaybeReadable for Event {
21572164 ( 2 , payment_hash, required) ,
21582165 ( 4 , path, required_vec) ,
21592166 ( 6 , blinded_tail, option) ,
2167+ ( 8 , trampoline_path, optional_vec)
21602168 } ) ;
21612169 Ok ( Some ( Event :: ProbeSuccessful {
21622170 payment_id : payment_id. 0 . unwrap ( ) ,
21632171 payment_hash : payment_hash. 0 . unwrap ( ) ,
2164- path : Path { hops : path, blinded_tail } ,
2172+ path : Path { hops : path, trampoline_hops : trampoline_path . unwrap_or ( vec ! [ ] ) , blinded_tail } ,
21652173 } ) )
21662174 } ;
21672175 f ( )
@@ -2174,11 +2182,12 @@ impl MaybeReadable for Event {
21742182 ( 4 , path, required_vec) ,
21752183 ( 6 , short_channel_id, option) ,
21762184 ( 8 , blinded_tail, option) ,
2185+ ( 10 , trampoline_path, optional_vec)
21772186 } ) ;
21782187 Ok ( Some ( Event :: ProbeFailed {
21792188 payment_id : payment_id. 0 . unwrap ( ) ,
21802189 payment_hash : payment_hash. 0 . unwrap ( ) ,
2181- path : Path { hops : path, blinded_tail } ,
2190+ path : Path { hops : path, trampoline_hops : trampoline_path . unwrap_or ( vec ! [ ] ) , blinded_tail } ,
21822191 short_channel_id,
21832192 } ) )
21842193 } ;
0 commit comments