Browse Source

Write guardfraction information to votes.

If a dirauth has guardfraction information about a guard, write it down
when serializing the routerstatus.
George Kadianakis 9 years ago
parent
commit
7ddfb6aa2f
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/or/dirserv.c

+ 7 - 0
src/or/dirserv.c

@@ -1922,6 +1922,13 @@ routerstatus_format_entry(const routerstatus_t *rs, const char *version,
       smartlist_add_asprintf(chunks,
                        " Measured=%d", vrs->measured_bw_kb);
     }
+    /* Write down guardfraction information if we have it. */
+    if (format == NS_V3_VOTE && vrs && vrs->status.has_guardfraction) {
+      smartlist_add_asprintf(chunks,
+                             " GuardFraction=%d",
+                             vrs->status.guardfraction_percentage);
+    }
+
     smartlist_add(chunks, tor_strdup("\n"));
 
     if (desc) {