File tree 3 files changed +8
-5
lines changed 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ pub(crate) struct ReceiveTlvs {
208
208
/// If `path_id` is `Some`, it is used to identify the blinded path that this onion message is
209
209
/// sending to. This is useful for receivers to check that said blinded path is being used in
210
210
/// the right context.
211
- pub ( super ) path_id : Option < [ u8 ; 32 ] > ,
211
+ pub ( super ) path_id : Option < Vec < u8 > > ,
212
212
}
213
213
214
214
impl Writeable for ForwardTlvs {
@@ -224,9 +224,12 @@ impl Writeable for ForwardTlvs {
224
224
225
225
impl Writeable for ReceiveTlvs {
226
226
fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , io:: Error > {
227
+ const EMPTY_PATH_ID : & Vec < u8 > = & vec ! [ ] ;
228
+ let path_id = self . path_id . as_ref ( ) . unwrap_or ( EMPTY_PATH_ID ) ;
229
+
227
230
// TODO: write padding
228
231
encode_tlv_stream ! ( writer, {
229
- ( 6 , self . path_id, option ) ,
232
+ ( 6 , * path_id, optional_vec ) ,
230
233
} ) ;
231
234
Ok ( ( ) )
232
235
}
Original file line number Diff line number Diff line change @@ -334,7 +334,7 @@ where
334
334
}
335
335
336
336
fn respond_with_onion_message < T : CustomOnionMessageContents > (
337
- & self , response : OnionMessageContents < T > , path_id : Option < [ u8 ; 32 ] > ,
337
+ & self , response : OnionMessageContents < T > , path_id : Option < Vec < u8 > > ,
338
338
reply_path : Option < BlindedPath >
339
339
) {
340
340
let sender = match self . node_signer . get_node_id ( Recipient :: Node ) {
Original file line number Diff line number Diff line change @@ -275,13 +275,13 @@ impl Readable for ControlTlvs {
275
275
let mut _padding: Option < Padding > = None ;
276
276
let mut _short_channel_id: Option < u64 > = None ;
277
277
let mut next_node_id: Option < PublicKey > = None ;
278
- let mut path_id: Option < [ u8 ; 32 ] > = None ;
278
+ let mut path_id: Option < Vec < u8 > > = None ;
279
279
let mut next_blinding_override: Option < PublicKey > = None ;
280
280
decode_tlv_stream ! ( & mut r, {
281
281
( 1 , _padding, option) ,
282
282
( 2 , _short_channel_id, option) ,
283
283
( 4 , next_node_id, option) ,
284
- ( 6 , path_id, option ) ,
284
+ ( 6 , path_id, optional_vec ) ,
285
285
( 8 , next_blinding_override, option) ,
286
286
} ) ;
287
287
You can’t perform that action at this time.
0 commit comments