aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-10-09 19:14:48 +0000
committerNick Mathewson <nickm@torproject.org>2007-10-09 19:14:48 +0000
commita2005cd2c128a73ac7e41667820353687f9b2667 (patch)
tree76f667158958d3a96b4f941edf18b0c2312725f3 /src/or/dirvote.c
parent40b6a66c89e37e9b144bd433cb01c6664c5fdc85 (diff)
downloadtor-a2005cd2c128a73ac7e41667820353687f9b2667.tar
tor-a2005cd2c128a73ac7e41667820353687f9b2667.tar.gz
r15590@catbus: nickm | 2007-10-09 15:14:42 -0400
Change dirvote_get_vote to take named flags rather than 3 boolean inputs. Fix a bug that was caused by the order of the boolean inputs in or.h not matching the order of boolean inputs in dirvote.c. svn:r11812
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 43d0b108f..6a96eb91f 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -1235,7 +1235,8 @@ dirvote_fetch_missing_votes(void)
{
if (!(ds->type & V3_AUTHORITY))
continue;
- if (!dirvote_get_vote(ds->v3_identity_digest, 1, 0, 1)) {
+ if (!dirvote_get_vote(ds->v3_identity_digest,
+ DGV_BY_ID|DGV_INCLUDE_PENDING)) {
char *cp = tor_malloc(HEX_DIGEST_LEN+1);
base16_encode(cp, HEX_DIGEST_LEN+1, ds->v3_identity_digest,
DIGEST_LEN);
@@ -1744,9 +1745,12 @@ dirvote_get_pending_detached_signatures(void)
* consensus that's in progress. May return NULL if we have no vote for the
* authority in question. */
const cached_dir_t *
-dirvote_get_vote(const char *fp, int by_id, int include_previous,
- int include_pending)
+dirvote_get_vote(const char *fp, int flags)
{
+ int by_id = flags & DGV_BY_ID;
+ const int include_pending = flags & DGV_INCLUDE_PENDING;
+ const int include_previous = flags & DGV_INCLUDE_PREVIOUS;
+
if (!pending_vote_list && !previous_vote_list)
return NULL;
if (fp == NULL) {