@@ -418,17 +418,17 @@ impl Responder {
418
418
pub fn respond ( self ) -> ResponseInstruction {
419
419
ResponseInstruction {
420
420
destination : Destination :: BlindedPath ( self . reply_path ) ,
421
- context : None ,
421
+ reply_data : ( None , None )
422
422
}
423
423
}
424
424
425
425
/// Creates a [`ResponseInstruction`] for responding including a reply path.
426
426
///
427
427
/// Use when the recipient needs to send back a reply to us.
428
- pub fn respond_with_reply_path ( self , context : MessageContext ) -> ResponseInstruction {
428
+ pub fn respond_with_reply_path ( self , context : MessageContext , custom_data : Option < Vec < u8 > > ) -> ResponseInstruction {
429
429
ResponseInstruction {
430
430
destination : Destination :: BlindedPath ( self . reply_path ) ,
431
- context : Some ( context) ,
431
+ reply_data : ( Some ( context) , custom_data ) ,
432
432
}
433
433
}
434
434
}
@@ -440,7 +440,7 @@ pub struct ResponseInstruction {
440
440
/// [`Destination`] rather than an explicit [`BlindedMessagePath`] simplifies the logic in
441
441
/// [`OnionMessenger::send_onion_message_internal`] somewhat.
442
442
destination : Destination ,
443
- context : Option < MessageContext > ,
443
+ reply_data : ( Option < MessageContext > , Option < Vec < u8 > > )
444
444
}
445
445
446
446
impl ResponseInstruction {
@@ -469,7 +469,7 @@ pub enum MessageSendInstructions {
469
469
destination : Destination ,
470
470
/// The context to include in the reply path we'll give the recipient so they can respond
471
471
/// to us.
472
- context : MessageContext ,
472
+ reply_data : ( MessageContext , Option < Vec < u8 > > ) ,
473
473
} ,
474
474
/// Indicates that a message should be sent without including a reply path, preventing the
475
475
/// recipient from responding.
@@ -874,7 +874,7 @@ pub trait CustomOnionMessageHandler {
874
874
///
875
875
/// The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
876
876
fn handle_custom_message (
877
- & self , message : Self :: CustomMessage , context : Option < Vec < u8 > > , responder : Option < Responder > ,
877
+ & self , message : Self :: CustomMessage , context : Option < Vec < u8 > > , custom_data : Option < Vec < u8 > > , responder : Option < Responder > ,
878
878
) -> Option < ( Self :: CustomMessage , ResponseInstruction ) > ;
879
879
880
880
/// Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
@@ -1315,10 +1315,10 @@ where
1315
1315
MessageSendInstructions :: WithSpecifiedReplyPath { destination, reply_path } => {
1316
1316
( destination, Some ( reply_path) )
1317
1317
} ,
1318
- MessageSendInstructions :: WithReplyPath { destination, context }
1318
+ MessageSendInstructions :: WithReplyPath { destination, reply_data : ( context, custom_data ) }
1319
1319
| MessageSendInstructions :: ForReply {
1320
- instructions : ResponseInstruction { destination, context : Some ( context) } ,
1321
- } => match self . create_blinded_path ( context) {
1320
+ instructions : ResponseInstruction { destination, reply_data : ( Some ( context) , custom_data ) } ,
1321
+ } => match self . create_blinded_path ( context, custom_data ) {
1322
1322
Ok ( reply_path) => ( destination, Some ( reply_path) ) ,
1323
1323
Err ( err) => {
1324
1324
log_trace ! (
@@ -1332,7 +1332,7 @@ where
1332
1332
} ,
1333
1333
MessageSendInstructions :: WithoutReplyPath { destination }
1334
1334
| MessageSendInstructions :: ForReply {
1335
- instructions : ResponseInstruction { destination, context : None } ,
1335
+ instructions : ResponseInstruction { destination, reply_data : ( None , _ ) } ,
1336
1336
} => ( destination, None ) ,
1337
1337
} ;
1338
1338
@@ -1390,7 +1390,7 @@ where
1390
1390
}
1391
1391
1392
1392
fn create_blinded_path (
1393
- & self , context : MessageContext ,
1393
+ & self , context : MessageContext , custom_data : Option < Vec < u8 > > ,
1394
1394
) -> Result < BlindedMessagePath , SendError > {
1395
1395
let recipient = self
1396
1396
. node_signer
@@ -1409,7 +1409,7 @@ where
1409
1409
1410
1410
let recipient_tlvs = ReceiveTlvs {
1411
1411
context : Some ( context) ,
1412
- custom_data : None ,
1412
+ custom_data,
1413
1413
} ;
1414
1414
1415
1415
self . message_router
@@ -1915,7 +1915,7 @@ where
1915
1915
} ,
1916
1916
} ;
1917
1917
let response_instructions =
1918
- self . custom_handler . handle_custom_message ( msg, context, responder) ;
1918
+ self . custom_handler . handle_custom_message ( msg, context, custom_data , responder) ;
1919
1919
if let Some ( ( msg, instructions) ) = response_instructions {
1920
1920
let _ = self . handle_onion_message_response ( msg, instructions) ;
1921
1921
}
0 commit comments