diff options
author | Roger Dingledine <arma@torproject.org> | 2012-01-08 12:17:16 -0500 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2012-01-08 12:17:16 -0500 |
commit | ecdea4eeafd921f0dcb053f2585d9cb05d6df658 (patch) | |
tree | 928e863bccd8dd871eaf098bb77a2a1541510fad /src/or/networkstatus.c | |
parent | 59d0a5ae693efe9321e03302515d405094998e43 (diff) | |
parent | cc1580dbe02f0f285fca65b7b388d99dbaf78f5c (diff) | |
download | tor-ecdea4eeafd921f0dcb053f2585d9cb05d6df658.tar.gz tor-ecdea4eeafd921f0dcb053f2585d9cb05d6df658.zip |
Merge branch 'maint-0.2.2'
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 7cd9d02c3f..a835e78b85 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -486,6 +486,8 @@ networkstatus_check_consensus_signature(networkstatus_t *consensus, int n_no_signature = 0; int n_v3_authorities = get_n_authorities(V3_DIRINFO); int n_required = n_v3_authorities/2 + 1; + smartlist_t *list_good = smartlist_create(); + smartlist_t *list_no_signature = smartlist_create(); smartlist_t *need_certs_from = smartlist_create(); smartlist_t *unrecognized = smartlist_create(); smartlist_t *missing_authorities = smartlist_create(); @@ -536,11 +538,13 @@ networkstatus_check_consensus_signature(networkstatus_t *consensus, else if (sig->bad_signature) ++bad_here; } SMARTLIST_FOREACH_END(sig); - if (good_here) + + if (good_here) { ++n_good; - else if (bad_here) + smartlist_add(list_good, voter->nickname); + } else if (bad_here) { ++n_bad; - else if (missing_key_here) { + } else if (missing_key_here) { ++n_missing_key; if (dl_failed_key_here) ++n_dl_failed_key; @@ -548,6 +552,7 @@ networkstatus_check_consensus_signature(networkstatus_t *consensus, ++n_unknown; } else { ++n_no_signature; + smartlist_add(list_no_signature, voter->nickname); } } SMARTLIST_FOREACH_END(voter); @@ -595,13 +600,17 @@ networkstatus_check_consensus_signature(networkstatus_t *consensus, { smartlist_t *sl = smartlist_create(); char *cp; + char *tmp = smartlist_join_strings(list_good, " ", 0, NULL); tor_asprintf(&cp, "A consensus needs %d good signatures from recognized " - "authorities for us to accept it. This one has %d.", - n_required, n_good); + "authorities for us to accept it. This one has %d (%s).", + n_required, n_good, tmp); + tor_free(tmp); smartlist_add(sl,cp); if (n_no_signature) { - tor_asprintf(&cp, "%d of the authorities we know didn't sign it.", - n_no_signature); + tmp = smartlist_join_strings(list_no_signature, " ", 0, NULL); + tor_asprintf(&cp, "%d (%s) of the authorities we know didn't sign it.", + n_no_signature, tmp); + tor_free(tmp); smartlist_add(sl,cp); } if (n_unknown) { @@ -627,6 +636,8 @@ networkstatus_check_consensus_signature(networkstatus_t *consensus, } } + smartlist_free(list_good); + smartlist_free(list_no_signature); smartlist_free(unrecognized); smartlist_free(need_certs_from); smartlist_free(missing_authorities); |