more refactor

This commit is contained in:
John Smith
2023-02-25 19:51:14 -05:00
parent 7962d3fe11
commit 4bc3f950df
17 changed files with 587 additions and 529 deletions

View File

@@ -4,8 +4,8 @@ use super::*;
#[derive(Clone, Debug)]
pub enum Target {
NodeId(PublicKey), // Node by any of its public keys
PrivateRoute(String), // Private route by its route set id
NodeId(PublicKey), // Node by any of its public keys
PrivateRoute(RouteId), // Remote private route by its id
}
pub struct RoutingContextInner {}
@@ -121,14 +121,13 @@ impl RoutingContext {
Target::PrivateRoute(rsid) => {
// Get remote private route
let rss = self.api.routing_table()?.route_spec_store();
let Some(private_route) = rss
.get_remote_private_route(&rsid)
if !rss.is_valid_remote_private_route(&rsid)
else {
apibail_key_not_found!(pr);
};
Ok(rpc_processor::Destination::PrivateRoute {
private_route: rsid,
private_route_id: rsid,
safety_selection: self.unlocked_inner.safety_selection,
})
}