checkpoint

This commit is contained in:
John Smith
2022-12-08 10:24:33 -05:00
parent 847623f2b4
commit 0b059e0ef9
16 changed files with 427 additions and 241 deletions

View File

@@ -374,15 +374,30 @@ impl RoutingTable {
}
/// Return a copy of our node's peerinfo
pub fn get_own_peer_info(&self, routing_domain: RoutingDomain) -> PeerInfo {
pub fn get_own_peer_info(&self, routing_domain: RoutingDomain) -> Option<PeerInfo> {
self.inner.read().get_own_peer_info(routing_domain)
}
/// Return the best effort copy of our node's peerinfo
/// This may be invalid and should not be passed to other nodes,
/// but may be used for contact method calculation
pub fn get_best_effort_own_peer_info(&self, routing_domain: RoutingDomain) -> PeerInfo {
self.inner
.read()
.get_best_effort_own_peer_info(routing_domain)
}
/// If we have a valid network class in this routing domain, then our 'NodeInfo' is valid
/// If this is true, we can get our final peer info, otherwise we only have a 'best effort' peer info
pub fn has_valid_own_node_info(&self, routing_domain: RoutingDomain) -> bool {
self.inner.read().has_valid_own_node_info(routing_domain)
}
/// Return our current node info timestamp
pub fn get_own_node_info_ts(&self, routing_domain: RoutingDomain) -> Option<u64> {
self.inner.read().get_own_node_info_ts(routing_domain)
}
/// Return the domain's currently registered network class
pub fn get_network_class(&self, routing_domain: RoutingDomain) -> Option<NetworkClass> {
self.inner.read().get_network_class(routing_domain)