@@ -30,7 +30,7 @@ use crate::routing::gossip::NetworkUpdate;
3030use crate :: util:: errors:: APIError ;
3131use crate :: util:: ser:: { BigSize , FixedLengthReader , Writeable , Writer , MaybeReadable , Readable , RequiredWrapper , UpgradableRequired , WithoutLength } ;
3232use crate :: util:: string:: UntrustedString ;
33- use crate :: routing:: router:: { Path , RouteHop , RouteParameters } ;
33+ use crate :: routing:: router:: { BlindedTail , Path , RouteHop , RouteParameters } ;
3434
3535use bitcoin:: { PackedLockTime , Transaction , OutPoint } ;
3636#[ cfg( anchors) ]
@@ -884,6 +884,7 @@ impl Writeable for Event {
884884 ( 1 , None :: <NetworkUpdate >, option) , // network_update in LDK versions prior to 0.0.114
885885 ( 2 , payment_failed_permanently, required) ,
886886 ( 3 , false , required) , // all_paths_failed in LDK versions prior to 0.0.114
887+ ( 4 , path. blinded_tail, option) ,
887888 ( 5 , path. hops, vec_type) ,
888889 ( 7 , short_channel_id, option) ,
889890 ( 9 , None :: <RouteParameters >, option) , // retry in LDK versions prior to 0.0.115
@@ -953,6 +954,7 @@ impl Writeable for Event {
953954 ( 0 , payment_id, required) ,
954955 ( 2 , payment_hash, option) ,
955956 ( 4 , path. hops, vec_type) ,
957+ ( 6 , path. blinded_tail, option) ,
956958 } )
957959 } ,
958960 & Event :: PaymentFailed { ref payment_id, ref payment_hash, ref reason } => {
@@ -983,6 +985,7 @@ impl Writeable for Event {
983985 ( 0 , payment_id, required) ,
984986 ( 2 , payment_hash, required) ,
985987 ( 4 , path. hops, vec_type) ,
988+ ( 6 , path. blinded_tail, option) ,
986989 } )
987990 } ,
988991 & Event :: ProbeFailed { ref payment_id, ref payment_hash, ref path, ref short_channel_id } => {
@@ -992,6 +995,7 @@ impl Writeable for Event {
992995 ( 2 , payment_hash, required) ,
993996 ( 4 , path. hops, vec_type) ,
994997 ( 6 , short_channel_id, option) ,
998+ ( 8 , path. blinded_tail, option) ,
995999 } )
9961000 } ,
9971001 & Event :: HTLCHandlingFailed { ref prev_channel_id, ref failed_next_destination } => {
@@ -1122,6 +1126,7 @@ impl MaybeReadable for Event {
11221126 let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
11231127 let mut payment_failed_permanently = false ;
11241128 let mut network_update = None ;
1129+ let mut blinded_tail: Option < BlindedTail > = None ;
11251130 let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
11261131 let mut short_channel_id = None ;
11271132 let mut payment_id = None ;
@@ -1130,6 +1135,7 @@ impl MaybeReadable for Event {
11301135 ( 0 , payment_hash, required) ,
11311136 ( 1 , network_update, upgradable_option) ,
11321137 ( 2 , payment_failed_permanently, required) ,
1138+ ( 4 , blinded_tail, option) ,
11331139 ( 5 , path, vec_type) ,
11341140 ( 7 , short_channel_id, option) ,
11351141 ( 11 , payment_id, option) ,
@@ -1141,7 +1147,7 @@ impl MaybeReadable for Event {
11411147 payment_hash,
11421148 payment_failed_permanently,
11431149 failure,
1144- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1150+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
11451151 short_channel_id,
11461152 #[ cfg( test) ]
11471153 error_code,
@@ -1244,18 +1250,16 @@ impl MaybeReadable for Event {
12441250 } ,
12451251 13u8 => {
12461252 let f = || {
1247- let mut payment_id = PaymentId ( [ 0 ; 32 ] ) ;
1248- let mut payment_hash = None ;
1249- let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1250- read_tlv_fields ! ( reader, {
1253+ _init_and_read_tlv_fields ! ( reader, {
12511254 ( 0 , payment_id, required) ,
12521255 ( 2 , payment_hash, option) ,
12531256 ( 4 , path, vec_type) ,
1257+ ( 6 , blinded_tail, option) ,
12541258 } ) ;
12551259 Ok ( Some ( Event :: PaymentPathSuccessful {
1256- payment_id,
1260+ payment_id : payment_id . 0 . unwrap ( ) ,
12571261 payment_hash,
1258- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1262+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
12591263 } ) )
12601264 } ;
12611265 f ( )
@@ -1305,38 +1309,33 @@ impl MaybeReadable for Event {
13051309 } ,
13061310 21u8 => {
13071311 let f = || {
1308- let mut payment_id = PaymentId ( [ 0 ; 32 ] ) ;
1309- let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
1310- let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1311- read_tlv_fields ! ( reader, {
1312+ _init_and_read_tlv_fields ! ( reader, {
13121313 ( 0 , payment_id, required) ,
13131314 ( 2 , payment_hash, required) ,
13141315 ( 4 , path, vec_type) ,
1316+ ( 6 , blinded_tail, option) ,
13151317 } ) ;
13161318 Ok ( Some ( Event :: ProbeSuccessful {
1317- payment_id,
1318- payment_hash,
1319- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1319+ payment_id : payment_id . 0 . unwrap ( ) ,
1320+ payment_hash : payment_hash . 0 . unwrap ( ) ,
1321+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
13201322 } ) )
13211323 } ;
13221324 f ( )
13231325 } ,
13241326 23u8 => {
13251327 let f = || {
1326- let mut payment_id = PaymentId ( [ 0 ; 32 ] ) ;
1327- let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
1328- let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1329- let mut short_channel_id = None ;
1330- read_tlv_fields ! ( reader, {
1328+ _init_and_read_tlv_fields ! ( reader, {
13311329 ( 0 , payment_id, required) ,
13321330 ( 2 , payment_hash, required) ,
13331331 ( 4 , path, vec_type) ,
13341332 ( 6 , short_channel_id, option) ,
1333+ ( 8 , blinded_tail, option) ,
13351334 } ) ;
13361335 Ok ( Some ( Event :: ProbeFailed {
1337- payment_id,
1338- payment_hash,
1339- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1336+ payment_id : payment_id . 0 . unwrap ( ) ,
1337+ payment_hash : payment_hash . 0 . unwrap ( ) ,
1338+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
13401339 short_channel_id,
13411340 } ) )
13421341 } ;
0 commit comments