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 @@ -234,6 +234,8 @@ pub enum ResponseError {
234
234
GetNodeIdFailed ,
235
235
/// No reply path in the onion message.
236
236
NoReplyPath ,
237
+ /// Could not find a route to the destination.
238
+ RouteNotFound ,
237
239
/// Failed to send the reply.
238
240
Sending ( SendError ) ,
239
241
}
@@ -348,7 +350,16 @@ where
348
350
} ,
349
351
} ;
350
352
351
- let intermediate_nodes = self . message_router . find_route ( & sender, & destination) ;
353
+ let intermediate_nodes = match self . message_router . find_route ( & sender, & destination) {
354
+ Some ( intermediate_nodes) => intermediate_nodes,
355
+ None => {
356
+ log_info ! (
357
+ self . logger, "No route to respond to onion message with path_id {:02x?}" ,
358
+ path_id
359
+ ) ;
360
+ return error_handler. handle_response_error ( ResponseError :: RouteNotFound ) ;
361
+ } ,
362
+ } ;
352
363
353
364
log_info ! ( self . logger, "Responding to onion message with path_id {:02x?}" , path_id) ;
354
365
You can’t perform that action at this time.
0 commit comments