[tor-commits] [tor/master] Write guardfraction information to votes.

nickm at torproject.org nickm at torproject.org
Wed Feb 18 14:20:13 UTC 2015


commit 7ddfb6aa2f3779da8bacd0574f152f558a5a508e
Author: George Kadianakis <desnacked at riseup.net>
Date:   Thu Jan 29 14:55:35 2015 +0000

    Write guardfraction information to votes.
    
    If a dirauth has guardfraction information about a guard, write it down
    when serializing the routerstatus.
---
 src/or/dirserv.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 0d3e782..10b9e63 100644
--- a/src/or/dirserv.c
+++ b/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) {





More information about the tor-commits mailing list