more semantics

This commit is contained in:
Christien Rioux
2023-07-14 19:37:06 -04:00
parent e61d6be6a9
commit 4960d13447
5 changed files with 34 additions and 16 deletions

View File

@@ -9,10 +9,6 @@ impl RoutingTable {
_last_ts: Timestamp,
cur_ts: Timestamp,
) -> EyreResult<()> {
// Get our node's current node info and network class and do the right thing
if !self.has_valid_network_class(RoutingDomain::PublicInternet) {
return Ok(());
}
let own_peer_info = self.get_own_peer_info(RoutingDomain::PublicInternet);
let own_node_info = own_peer_info.signed_node_info().node_info();
let network_class = own_node_info.network_class();
@@ -48,6 +44,15 @@ impl RoutingTable {
);
editor.clear_relay_node();
false
}
// Should not have relay for invalid network class
else if !self.has_valid_network_class(RoutingDomain::PublicInternet) {
info!(
"Invalid network class does not get a relay, dropping relay {}",
relay_node
);
editor.clear_relay_node();
false
} else {
true
}