File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
lightning/src/onion_message Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,8 @@ pub enum ResponseError {
236236 GetNodeIdFailed ,
237237 /// No reply path in the onion message.
238238 NoReplyPath ,
239+ /// Could not find a route to the destination.
240+ RouteNotFound ,
239241 /// Failed to send the reply.
240242 Sending ( SendError ) ,
241243}
@@ -350,7 +352,16 @@ where
350352 } ,
351353 } ;
352354
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+ } ;
354365
355366 log_info ! ( self . logger, "Responding to onion message with path_id {:02x?}" , path_id) ;
356367
You can’t perform that action at this time.
0 commit comments