From 5bf520d0f1291171a98fcd0753be2a28674309ec Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Mon, 27 Nov 2023 13:28:45 -0500 Subject: [PATCH] minor style/naming changes --- llarp/consensus/reachability_testing.cpp | 2 +- llarp/nodedb.cpp | 4 ++-- llarp/nodedb.hpp | 2 +- llarp/router/router.cpp | 4 ++-- llarp/router/router.hpp | 4 ++-- llarp/service/endpoint.cpp | 2 +- llarp/service/outbound_context.cpp | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/llarp/consensus/reachability_testing.cpp b/llarp/consensus/reachability_testing.cpp index a248f9cd7..1f5068255 100644 --- a/llarp/consensus/reachability_testing.cpp +++ b/llarp/consensus/reachability_testing.cpp @@ -104,7 +104,7 @@ namespace llarp::consensus // We exhausted the queue so repopulate it and try again testing_queue.clear(); - const auto all = router->router_whitelist(); + const auto all = router->get_whitelist(); testing_queue.insert(testing_queue.begin(), all.begin(), all.end()); std::shuffle(testing_queue.begin(), testing_queue.end(), llarp::csrng); diff --git a/llarp/nodedb.cpp b/llarp/nodedb.cpp index 5f47acf6e..092bebb6d 100644 --- a/llarp/nodedb.cpp +++ b/llarp/nodedb.cpp @@ -152,7 +152,7 @@ namespace llarp bool NodeDB::is_connection_allowed(const RouterID& remote) const { - if (pinned_edges.size() && pinned_edges.count(remote) == 0 && !bootstraps.count(remote)) + if (pinned_edges.size() && pinned_edges.count(remote) == 0 && bootstraps.count(remote) == 0) { return false; } @@ -243,7 +243,7 @@ namespace llarp } bool - NodeDB::has_router(RouterID pk) const + NodeDB::has_rc(RouterID pk) const { return known_rcs.count(pk); } diff --git a/llarp/nodedb.hpp b/llarp/nodedb.hpp index 286224848..e126004b8 100644 --- a/llarp/nodedb.hpp +++ b/llarp/nodedb.hpp @@ -154,7 +154,7 @@ namespace llarp /// return true if we have an rc by its ident pubkey bool - has_router(RouterID pk) const; + has_rc(RouterID pk) const; /// maybe get an rc by its ident pubkey std::optional diff --git a/llarp/router/router.cpp b/llarp/router/router.cpp index 6c5e04b59..8eb2c33c8 100644 --- a/llarp/router/router.cpp +++ b/llarp/router/router.cpp @@ -972,8 +972,8 @@ namespace llarp return _link_manager.get_random_connected(result); } - std::unordered_set - Router::router_whitelist() const + const std::unordered_set& + Router::get_whitelist() const { return _node_db->whitelist(); } diff --git a/llarp/router/router.hpp b/llarp/router/router.hpp index faf8908fc..edf7cabad 100644 --- a/llarp/router/router.hpp +++ b/llarp/router/router.hpp @@ -275,8 +275,8 @@ namespace llarp util::StatusObject ExtractSummaryStatus() const; - std::unordered_set - router_whitelist() const; + const std::unordered_set& + get_whitelist() const; void set_router_whitelist( diff --git a/llarp/service/endpoint.cpp b/llarp/service/endpoint.cpp index 6cf14dc95..dabc654da 100644 --- a/llarp/service/endpoint.cpp +++ b/llarp/service/endpoint.cpp @@ -1229,7 +1229,7 @@ namespace llarp::service this); _state->snode_sessions[snode] = session; } - if (not router()->node_db()->has_router(snode)) + if (not router()->node_db()->has_rc(snode)) return false; auto range = nodeSessions.equal_range(snode); auto itr = range.first; diff --git a/llarp/service/outbound_context.cpp b/llarp/service/outbound_context.cpp index 717cd7700..fe0218416 100644 --- a/llarp/service/outbound_context.cpp +++ b/llarp/service/outbound_context.cpp @@ -409,7 +409,7 @@ namespace llarp::service auto itr = intros.begin(); while (itr != intros.end()) { - if (not ep.router()->node_db()->has_router(itr->router)) + if (not ep.router()->node_db()->has_rc(itr->router)) { itr = intros.erase(itr); continue;