File tree 1 file changed +12
-1
lines changed
lightning/src/onion_message
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,8 @@ pub enum ResponseError {
236
236
GetNodeIdFailed ,
237
237
/// No reply path in the onion message.
238
238
NoReplyPath ,
239
+ /// Could not find a route to the destination.
240
+ RouteNotFound ,
239
241
/// Failed to send the reply.
240
242
Sending ( SendError ) ,
241
243
}
@@ -350,7 +352,16 @@ where
350
352
} ,
351
353
} ;
352
354
353
- let intermediate_nodes = self . message_router . find_route ( & sender, & destination) ;
355
+ let intermediate_nodes = match self . message_router . find_route ( & sender, & destination) {
356
+ Some ( intermediate_nodes) => intermediate_nodes,
357
+ None => {
358
+ log_info ! (
359
+ self . logger, "No route to respond to onion message with path_id {:02x?}" ,
360
+ path_id
361
+ ) ;
362
+ return error_handler. handle_response_error ( ResponseError :: RouteNotFound ) ;
363
+ } ,
364
+ } ;
354
365
355
366
log_info ! ( self . logger, "Responding to onion message with path_id {:02x?}" , path_id) ;
356
367
You can’t perform that action at this time.
0 commit comments