@@ -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) ]
@@ -901,6 +901,7 @@ impl Writeable for Event {
901
901
( 0 , payment_id, required) ,
902
902
( 2 , payment_hash, option) ,
903
903
( 4 , path. hops, vec_type) ,
904
+ ( 6 , path. blinded_tail, option) ,
904
905
} )
905
906
} ,
906
907
& Event :: PaymentFailed { ref payment_id, ref payment_hash } => {
@@ -930,6 +931,7 @@ impl Writeable for Event {
930
931
( 0 , payment_id, required) ,
931
932
( 2 , payment_hash, required) ,
932
933
( 4 , path. hops, vec_type) ,
934
+ ( 6 , path. blinded_tail, option) ,
933
935
} )
934
936
} ,
935
937
& Event :: ProbeFailed { ref payment_id, ref payment_hash, ref path, ref short_channel_id } => {
@@ -939,6 +941,7 @@ impl Writeable for Event {
939
941
( 2 , payment_hash, required) ,
940
942
( 4 , path. hops, vec_type) ,
941
943
( 6 , short_channel_id, option) ,
944
+ ( 8 , path. blinded_tail, option) ,
942
945
} )
943
946
} ,
944
947
& Event :: HTLCHandlingFailed { ref prev_channel_id, ref failed_next_destination } => {
@@ -1066,6 +1069,7 @@ impl MaybeReadable for Event {
1066
1069
let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
1067
1070
let mut payment_failed_permanently = false ;
1068
1071
let mut network_update = None ;
1072
+ let mut blinded_tail: Option < BlindedTail > = None ;
1069
1073
let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1070
1074
let mut short_channel_id = None ;
1071
1075
let mut payment_id = None ;
@@ -1074,6 +1078,7 @@ impl MaybeReadable for Event {
1074
1078
( 0 , payment_hash, required) ,
1075
1079
( 1 , network_update, upgradable_option) ,
1076
1080
( 2 , payment_failed_permanently, required) ,
1081
+ ( 4 , blinded_tail, option) ,
1077
1082
( 5 , path, vec_type) ,
1078
1083
( 7 , short_channel_id, option) ,
1079
1084
( 11 , payment_id, option) ,
@@ -1085,7 +1090,7 @@ impl MaybeReadable for Event {
1085
1090
payment_hash,
1086
1091
payment_failed_permanently,
1087
1092
failure,
1088
- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1093
+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
1089
1094
short_channel_id,
1090
1095
#[ cfg( test) ]
1091
1096
error_code,
@@ -1188,18 +1193,16 @@ impl MaybeReadable for Event {
1188
1193
} ,
1189
1194
13u8 => {
1190
1195
let f = || {
1191
- let mut payment_id = PaymentId ( [ 0 ; 32 ] ) ;
1192
- let mut payment_hash = None ;
1193
- let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1194
- read_tlv_fields ! ( reader, {
1196
+ _init_and_read_tlv_fields ! ( reader, {
1195
1197
( 0 , payment_id, required) ,
1196
1198
( 2 , payment_hash, option) ,
1197
1199
( 4 , path, vec_type) ,
1200
+ ( 6 , blinded_tail, option) ,
1198
1201
} ) ;
1199
1202
Ok ( Some ( Event :: PaymentPathSuccessful {
1200
- payment_id,
1203
+ payment_id : payment_id . 0 . unwrap ( ) ,
1201
1204
payment_hash,
1202
- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1205
+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
1203
1206
} ) )
1204
1207
} ;
1205
1208
f ( )
@@ -1246,38 +1249,33 @@ impl MaybeReadable for Event {
1246
1249
} ,
1247
1250
21u8 => {
1248
1251
let f = || {
1249
- let mut payment_id = PaymentId ( [ 0 ; 32 ] ) ;
1250
- let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
1251
- let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1252
- read_tlv_fields ! ( reader, {
1252
+ _init_and_read_tlv_fields ! ( reader, {
1253
1253
( 0 , payment_id, required) ,
1254
1254
( 2 , payment_hash, required) ,
1255
1255
( 4 , path, vec_type) ,
1256
+ ( 6 , blinded_tail, option) ,
1256
1257
} ) ;
1257
1258
Ok ( Some ( Event :: ProbeSuccessful {
1258
- payment_id,
1259
- payment_hash,
1260
- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1259
+ payment_id : payment_id . 0 . unwrap ( ) ,
1260
+ payment_hash : payment_hash . 0 . unwrap ( ) ,
1261
+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
1261
1262
} ) )
1262
1263
} ;
1263
1264
f ( )
1264
1265
} ,
1265
1266
23u8 => {
1266
1267
let f = || {
1267
- let mut payment_id = PaymentId ( [ 0 ; 32 ] ) ;
1268
- let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
1269
- let mut path: Option < Vec < RouteHop > > = Some ( vec ! [ ] ) ;
1270
- let mut short_channel_id = None ;
1271
- read_tlv_fields ! ( reader, {
1268
+ _init_and_read_tlv_fields ! ( reader, {
1272
1269
( 0 , payment_id, required) ,
1273
1270
( 2 , payment_hash, required) ,
1274
1271
( 4 , path, vec_type) ,
1275
1272
( 6 , short_channel_id, option) ,
1273
+ ( 8 , blinded_tail, option) ,
1276
1274
} ) ;
1277
1275
Ok ( Some ( Event :: ProbeFailed {
1278
- payment_id,
1279
- payment_hash,
1280
- path : Path { hops : path. unwrap ( ) , blinded_tail : None } ,
1276
+ payment_id : payment_id . 0 . unwrap ( ) ,
1277
+ payment_hash : payment_hash . 0 . unwrap ( ) ,
1278
+ path : Path { hops : path. unwrap ( ) , blinded_tail } ,
1281
1279
short_channel_id,
1282
1280
} ) )
1283
1281
} ;
0 commit comments