[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor] 01/04: Actually count exits with conflux support, rather than relays.



This is an automated email from the git hooks/post-receive script.

dgoulet pushed a commit to branch main
in repository tor.

commit 61aa4c3657b43e11414f8c607aadfad87eea40fd
Author: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
AuthorDate: Tue Apr 18 16:51:07 2023 +0000

    Actually count exits with conflux support, rather than relays.
---
 src/core/or/conflux_params.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/core/or/conflux_params.c b/src/core/or/conflux_params.c
index f149e3356c..dbf4ae5272 100644
--- a/src/core/or/conflux_params.c
+++ b/src/core/or/conflux_params.c
@@ -100,19 +100,28 @@ static void
 count_exit_with_conflux_support(const networkstatus_t *ns)
 {
   double supported = 0.0;
+  int total_exits = 0;
 
   if (!ns || smartlist_len(ns->routerstatus_list) == 0) {
     return;
   }
 
   SMARTLIST_FOREACH_BEGIN(ns->routerstatus_list, const routerstatus_t *, rs) {
+    if (!rs->is_exit || rs->is_bad_exit) {
+      continue;
+    }
     if (rs->pv.supports_conflux) {
       supported++;
     }
+    total_exits++;
   } SMARTLIST_FOREACH_END(rs);
 
-  exit_conflux_ratio =
-    supported / smartlist_len(ns->routerstatus_list);
+  if (total_exits > 0) {
+    exit_conflux_ratio =
+      supported / total_exits;
+  } else {
+    exit_conflux_ratio = 0.0;
+  }
 
   log_info(LD_GENERAL, "Consensus has %.2f %% Exit relays supporting Conflux",
            exit_conflux_ratio * 100.0);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits