pr management work

This commit is contained in:
John Smith
2022-11-25 14:21:55 -05:00
parent 05be3c8cc5
commit 79f55f1a0c
11 changed files with 464 additions and 90 deletions

View File

@@ -116,6 +116,18 @@ impl PrivateRoute {
PrivateRouteHops::Empty => return None,
}
}
pub fn first_hop_node_id(&self) -> Option<DHTKey> {
let PrivateRouteHops::FirstHop(pr_first_hop) = &self.hops else {
return None;
};
// Get the safety route to use from the spec
Some(match &pr_first_hop.node {
RouteNode::NodeId(n) => n.key,
RouteNode::PeerInfo(p) => p.node_id.key,
})
}
}
impl fmt::Display for PrivateRoute {