summaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-10-02 20:35:23 +0000
committerNick Mathewson <nickm@torproject.org>2007-10-02 20:35:23 +0000
commit8439c4ec2f96d60c4801a87efdfd8707606dcf62 (patch)
tree8322c1d7dedb8afa0cfe16c6cc260a6e85193dae /src/or/dirvote.c
parentf4f780b526df83032748782fb5917a7ee7412902 (diff)
downloadtor-8439c4ec2f96d60c4801a87efdfd8707606dcf62.tar.gz
tor-8439c4ec2f96d60c4801a87efdfd8707606dcf62.zip
r15512@catbus: nickm | 2007-10-02 16:27:43 -0400
Make some functions static; remove some dead code. svn:r11750
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c40
1 files changed, 8 insertions, 32 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 94025c54e3..b3f042cd8b 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -19,8 +19,10 @@ static int dirvote_add_signatures_to_pending_consensus(
static char *list_v3_auth_ids(void);
static void dirvote_fetch_missing_votes(void);
static void dirvote_fetch_missing_signatures(void);
-
-/* XXXX020 lots of the functions here could be made static. Do so. */
+static void dirvote_perform_vote(void);
+static void dirvote_clear_votes(int all_votes);
+static int dirvote_compute_consensus(void);
+static int dirvote_publish_consensus(void);
/* =====
* Voting and consensus generation
@@ -858,30 +860,6 @@ networkstatus_add_signatures_impl(networkstatus_vote_t *target,
return r;
}
-#if 0
-/** As networkstatus_add_consensus_signature_impl, but takes new signatures
- * from the consensus in <b>src</b>. */
-int
-networkstatus_add_consensus_signatures(networkstatus_vote_t *target,
- networkstatus_vote_t *src,
- char **new_signatures_out)
-{
- tor_assert(src);
- tor_assert(! src->is_vote);
-
- *new_signatures_out = NULL;
-
- /* Are they the same consensus? */
- if (memcmp(target->networkstatus_digest, src->networkstatus_digest,
- DIGEST_LEN))
- return -1;
- if (target == src)
- return 0;
-
- return networkstatus_add_signatures_impl(target, src->voters);
-}
-#endif
-
/** As networkstatus_add_consensus_signature_impl, but takes new signatures
* from the detached signatures document <b>sigs</b>. */
int
@@ -1217,7 +1195,7 @@ static smartlist_t *pending_consensus_signature_list = NULL;
/** Generate a networkstatus vote and post it to all the v3 authorities.
* (V3 Authority only) */
-void
+static void
dirvote_perform_vote(void)
{
cached_dir_t *new_vote = generate_v3_networkstatus();
@@ -1290,7 +1268,7 @@ dirvote_fetch_missing_signatures(void)
}
/** Drop all currently pending votes, consensus, and detached signatures. */
-void
+static void
dirvote_clear_votes(int all_votes)
{
if (!previous_vote_list)
@@ -1490,7 +1468,7 @@ dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out)
* votes. Return 0 on success, -1 on failure. Store the consensus in
* pending_consensus: it won't be ready to be published until we have
* everybody else's signatures collected too. (V3 Authoritity only) */
-int
+static int
dirvote_compute_consensus(void)
{
/* Have we got enough votes to try? */
@@ -1616,8 +1594,6 @@ dirvote_add_signatures_to_pending_consensus(
r = networkstatus_add_detached_signatures(pending_consensus,
sigs);
- // XXXX020 originally, this test was regenerate && r >= 0). But one
- // code path is simpler than 2.
if (r >= 0) {
/* XXXX This should really be its own function. */
char *new_detached =
@@ -1685,7 +1661,7 @@ dirvote_add_signatures(const char *detached_signatures_body)
/** Replace the consensus that we're currently serving with the one that we've
* been building. (V3 Authority only) */
-int
+static int
dirvote_publish_consensus(void)
{
/* Can we actually publish it yet? */