@@ -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) ]
@@ -941,6 +941,7 @@ impl Writeable for Event {
941
941
( 0 , payment_id, required) ,
942
942
( 2 , payment_hash, option) ,
943
943
( 4 , path. hops, vec_type) ,
944
+ ( 6 , path. blinded_tail, option) ,
944
945
} )
945
946
} ,
946
947
& Event :: PaymentFailed { ref payment_id, ref payment_hash, ref reason } => {
@@ -971,6 +972,7 @@ impl Writeable for Event {
971
972
( 0 , payment_id, required) ,
972
973
( 2 , payment_hash, required) ,
973
974
( 4 , path. hops, vec_type) ,
975
+ ( 6 , path. blinded_tail, option) ,
974
976
} )
975
977
} ,
976
978
& Event :: ProbeFailed { ref payment_id, ref payment_hash, ref path, ref short_channel_id } => {
@@ -980,6 +982,7 @@ impl Writeable for Event {
980
982
( 2 , payment_hash, required) ,
981
983
( 4 , path. hops, vec_type) ,
982
984
( 6 , short_channel_id, option) ,
985
+ ( 8 , path. blinded_tail, option) ,
983
986
} )
984
987
} ,
985
988
& Event :: HTLCHandlingFailed { ref prev_channel_id, ref failed_next_destination } => {
@@ -1107,6 +1110,7 @@ impl MaybeReadable for Event {
1107
1110
let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
1108
1111
let mut payment_failed_permanently = false ;
1109
1112
let mut network_update = None ;
1113
+ let mut blinded_tail: Option < BlindedTail > = None ;
1110
1114
let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1111
1115
let mut short_channel_id = None ;
1112
1116
let mut payment_id = None ;
@@ -1115,6 +1119,7 @@ impl MaybeReadable for Event {
1115
1119
( 0 , payment_hash, required) ,
1116
1120
( 1 , network_update, upgradable_option) ,
1117
1121
( 2 , payment_failed_permanently, required) ,
1122
+ ( 4 , blinded_tail, option) ,
1118
1123
( 5 , path, vec_type) ,
1119
1124
( 7 , short_channel_id, option) ,
1120
1125
( 11 , payment_id, option) ,
@@ -1126,7 +1131,7 @@ impl MaybeReadable for Event {
1126
1131
payment_hash,
1127
1132
payment_failed_permanently,
1128
1133
failure,
1129
- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1134
+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
1130
1135
short_channel_id,
1131
1136
#[ cfg( test) ]
1132
1137
error_code,
@@ -1229,18 +1234,16 @@ impl MaybeReadable for Event {
1229
1234
} ,
1230
1235
13u8 => {
1231
1236
let f = || {
1232
- let mut payment_id = PaymentId ( [ 0 ; 32 ] ) ;
1233
- let mut payment_hash = None ;
1234
- let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1235
- read_tlv_fields ! ( reader, {
1237
+ _init_and_read_tlv_fields ! ( reader, {
1236
1238
( 0 , payment_id, required) ,
1237
1239
( 2 , payment_hash, option) ,
1238
1240
( 4 , path, vec_type) ,
1241
+ ( 6 , blinded_tail, option) ,
1239
1242
} ) ;
1240
1243
Ok ( Some ( Event :: PaymentPathSuccessful {
1241
- payment_id,
1244
+ payment_id : payment_id . 0 . unwrap ( ) ,
1242
1245
payment_hash,
1243
- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1246
+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
1244
1247
} ) )
1245
1248
} ;
1246
1249
f ( )
@@ -1290,38 +1293,33 @@ impl MaybeReadable for Event {
1290
1293
} ,
1291
1294
21u8 => {
1292
1295
let f = || {
1293
- let mut payment_id = PaymentId ( [ 0 ; 32 ] ) ;
1294
- let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
1295
- let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1296
- read_tlv_fields ! ( reader, {
1296
+ _init_and_read_tlv_fields ! ( reader, {
1297
1297
( 0 , payment_id, required) ,
1298
1298
( 2 , payment_hash, required) ,
1299
1299
( 4 , path, vec_type) ,
1300
+ ( 6 , blinded_tail, option) ,
1300
1301
} ) ;
1301
1302
Ok ( Some ( Event :: ProbeSuccessful {
1302
- payment_id,
1303
- payment_hash,
1304
- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1303
+ payment_id : payment_id . 0 . unwrap ( ) ,
1304
+ payment_hash : payment_hash . 0 . unwrap ( ) ,
1305
+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
1305
1306
} ) )
1306
1307
} ;
1307
1308
f ( )
1308
1309
} ,
1309
1310
23u8 => {
1310
1311
let f = || {
1311
- let mut payment_id = PaymentId ( [ 0 ; 32 ] ) ;
1312
- let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
1313
- let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1314
- let mut short_channel_id = None ;
1315
- read_tlv_fields ! ( reader, {
1312
+ _init_and_read_tlv_fields ! ( reader, {
1316
1313
( 0 , payment_id, required) ,
1317
1314
( 2 , payment_hash, required) ,
1318
1315
( 4 , path, vec_type) ,
1319
1316
( 6 , short_channel_id, option) ,
1317
+ ( 8 , blinded_tail, option) ,
1320
1318
} ) ;
1321
1319
Ok ( Some ( Event :: ProbeFailed {
1322
- payment_id,
1323
- payment_hash,
1324
- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1320
+ payment_id : payment_id . 0 . unwrap ( ) ,
1321
+ payment_hash : payment_hash . 0 . unwrap ( ) ,
1322
+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
1325
1323
short_channel_id,
1326
1324
} ) )
1327
1325
} ;
0 commit comments