@@ -30,7 +30,7 @@ use crate::routing::gossip::NetworkUpdate;
30
30
use crate :: util:: errors:: APIError ;
31
31
use crate :: util:: ser:: { BigSize , FixedLengthReader , Writeable , Writer , MaybeReadable , Readable , RequiredWrapper , UpgradableRequired , WithoutLength } ;
32
32
use crate :: util:: string:: UntrustedString ;
33
- use crate :: routing:: router:: { Path , RouteHop , RouteParameters } ;
33
+ use crate :: routing:: router:: { BlindedTail , Path , RouteHop , RouteParameters } ;
34
34
35
35
use bitcoin:: { PackedLockTime , Transaction , OutPoint } ;
36
36
#[ cfg( anchors) ]
@@ -884,6 +884,7 @@ impl Writeable for Event {
884
884
( 1 , None :: <NetworkUpdate >, option) , // network_update in LDK versions prior to 0.0.114
885
885
( 2 , payment_failed_permanently, required) ,
886
886
( 3 , false , required) , // all_paths_failed in LDK versions prior to 0.0.114
887
+ ( 4 , path. blinded_tail, option) ,
887
888
( 5 , path. hops, vec_type) ,
888
889
( 7 , short_channel_id, option) ,
889
890
( 9 , None :: <RouteParameters >, option) , // retry in LDK versions prior to 0.0.115
@@ -953,6 +954,7 @@ impl Writeable for Event {
953
954
( 0 , payment_id, required) ,
954
955
( 2 , payment_hash, option) ,
955
956
( 4 , path. hops, vec_type) ,
957
+ ( 6 , path. blinded_tail, option) ,
956
958
} )
957
959
} ,
958
960
& Event :: PaymentFailed { ref payment_id, ref payment_hash, ref reason } => {
@@ -983,6 +985,7 @@ impl Writeable for Event {
983
985
( 0 , payment_id, required) ,
984
986
( 2 , payment_hash, required) ,
985
987
( 4 , path. hops, vec_type) ,
988
+ ( 6 , path. blinded_tail, option) ,
986
989
} )
987
990
} ,
988
991
& Event :: ProbeFailed { ref payment_id, ref payment_hash, ref path, ref short_channel_id } => {
@@ -992,6 +995,7 @@ impl Writeable for Event {
992
995
( 2 , payment_hash, required) ,
993
996
( 4 , path. hops, vec_type) ,
994
997
( 6 , short_channel_id, option) ,
998
+ ( 8 , path. blinded_tail, option) ,
995
999
} )
996
1000
} ,
997
1001
& Event :: HTLCHandlingFailed { ref prev_channel_id, ref failed_next_destination } => {
@@ -1122,6 +1126,7 @@ impl MaybeReadable for Event {
1122
1126
let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
1123
1127
let mut payment_failed_permanently = false ;
1124
1128
let mut network_update = None ;
1129
+ let mut blinded_tail: Option < BlindedTail > = None ;
1125
1130
let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1126
1131
let mut short_channel_id = None ;
1127
1132
let mut payment_id = None ;
@@ -1130,6 +1135,7 @@ impl MaybeReadable for Event {
1130
1135
( 0 , payment_hash, required) ,
1131
1136
( 1 , network_update, upgradable_option) ,
1132
1137
( 2 , payment_failed_permanently, required) ,
1138
+ ( 4 , blinded_tail, option) ,
1133
1139
( 5 , path, vec_type) ,
1134
1140
( 7 , short_channel_id, option) ,
1135
1141
( 11 , payment_id, option) ,
@@ -1141,7 +1147,7 @@ impl MaybeReadable for Event {
1141
1147
payment_hash,
1142
1148
payment_failed_permanently,
1143
1149
failure,
1144
- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1150
+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
1145
1151
short_channel_id,
1146
1152
#[ cfg( test) ]
1147
1153
error_code,
@@ -1244,18 +1250,16 @@ impl MaybeReadable for Event {
1244
1250
} ,
1245
1251
13u8 => {
1246
1252
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, {
1251
1254
( 0 , payment_id, required) ,
1252
1255
( 2 , payment_hash, option) ,
1253
1256
( 4 , path, vec_type) ,
1257
+ ( 6 , blinded_tail, option) ,
1254
1258
} ) ;
1255
1259
Ok ( Some ( Event :: PaymentPathSuccessful {
1256
- payment_id,
1260
+ payment_id : payment_id . 0 . unwrap ( ) ,
1257
1261
payment_hash,
1258
- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1262
+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
1259
1263
} ) )
1260
1264
} ;
1261
1265
f ( )
@@ -1305,38 +1309,33 @@ impl MaybeReadable for Event {
1305
1309
} ,
1306
1310
21u8 => {
1307
1311
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, {
1312
1313
( 0 , payment_id, required) ,
1313
1314
( 2 , payment_hash, required) ,
1314
1315
( 4 , path, vec_type) ,
1316
+ ( 6 , blinded_tail, option) ,
1315
1317
} ) ;
1316
1318
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 } ,
1320
1322
} ) )
1321
1323
} ;
1322
1324
f ( )
1323
1325
} ,
1324
1326
23u8 => {
1325
1327
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, {
1331
1329
( 0 , payment_id, required) ,
1332
1330
( 2 , payment_hash, required) ,
1333
1331
( 4 , path, vec_type) ,
1334
1332
( 6 , short_channel_id, option) ,
1333
+ ( 8 , blinded_tail, option) ,
1335
1334
} ) ;
1336
1335
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 } ,
1340
1339
short_channel_id,
1341
1340
} ) )
1342
1341
} ;
0 commit comments