Node icon indicating copy to clipboard operation
Node copied to clipboard

Avoid bothering the routing engine if there's no consuming wallet

Open dnwiebe opened this issue 1 year ago • 0 comments

The handler for RouteQueryMessage (perhaps RouteQueryRequest by the time this card is played) in Neighborhood invokes the Routing Engine to create a route before checking to see if a consuming wallet has been supplied.

Since the only routes that don't require a consuming wallet are Gossip routes, and RouteQueryMessage is never used for Gossip routes (because they're too simple to require it), every route requested by a RouteQueryMessage always requires a consuming wallet, and requiring the presence of a consuming wallet right when the RouteQueryMessage is received would prevent a call to the Routing Engine in cases where the work of the Routing Engine is about to be discarded anyway.

Move the consuming-wallet check from Neighborhood::compose_route_query_response() to Neighborhood::route_query_message(). If there's no consuming wallet, return None directly (with an appropriate error log) instead of calling deeper.

dnwiebe avatar Feb 26 '24 12:02 dnwiebe