File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 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 {
208208 /// If `path_id` is `Some`, it is used to identify the blinded path that this onion message is
209209 /// sending to. This is useful for receivers to check that said blinded path is being used in
210210 /// the right context.
211- pub ( super ) path_id : Option < [ u8 ; 32 ] > ,
211+ pub ( super ) path_id : Option < Vec < u8 > > ,
212212}
213213
214214impl Writeable for ForwardTlvs {
@@ -224,9 +224,12 @@ impl Writeable for ForwardTlvs {
224224
225225impl Writeable for ReceiveTlvs {
226226 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+
227230 // TODO: write padding
228231 encode_tlv_stream ! ( writer, {
229- ( 6 , self . path_id, option ) ,
232+ ( 6 , * path_id, optional_vec ) ,
230233 } ) ;
231234 Ok ( ( ) )
232235 }
Original file line number Diff line number Diff line change @@ -334,7 +334,7 @@ where
334334 }
335335
336336 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 > > ,
338338 reply_path : Option < BlindedPath >
339339 ) {
340340 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 {
275275 let mut _padding: Option < Padding > = None ;
276276 let mut _short_channel_id: Option < u64 > = None ;
277277 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 ;
279279 let mut next_blinding_override: Option < PublicKey > = None ;
280280 decode_tlv_stream ! ( & mut r, {
281281 ( 1 , _padding, option) ,
282282 ( 2 , _short_channel_id, option) ,
283283 ( 4 , next_node_id, option) ,
284- ( 6 , path_id, option ) ,
284+ ( 6 , path_id, optional_vec ) ,
285285 ( 8 , next_blinding_override, option) ,
286286 } ) ;
287287
You can’t perform that action at this time.
0 commit comments