diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-08-13 20:45:36 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-08-13 20:45:36 +0000 |
commit | 7d990b5aa104fff4c23eba2366bb215ac446e7b2 (patch) | |
tree | 56cedbc3dd8291290ef58590c3897889af83a0e2 /src/or/dirvote.c | |
parent | b4adf151d2a8dcfc92e9fe990e10dbee40617c80 (diff) | |
download | tor-7d990b5aa104fff4c23eba2366bb215ac446e7b2.tar.gz tor-7d990b5aa104fff4c23eba2366bb215ac446e7b2.zip |
r13992@Kushana: nickm | 2007-08-13 16:45:22 -0400
A vote we already have a nd a double-upload are different things.
svn:r11093
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index dd8bc7aa08..ccaa0f2891 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -1212,8 +1212,15 @@ dirvote_add_vote(const char *vote_body, const char **msg_out) if (! memcmp(v->vote->cert->cache_info.identity_digest, vote->cert->cache_info.identity_digest, DIGEST_LEN)) { - log_notice(LD_DIR, "We already have a pending vote from this dir"); - if (v->vote->published < vote->published) { + networkstatus_voter_info_t *vi_old = smartlist_get(v->vote->voters, 0); + if (!memcmp(vi_old->vote_digest, vi->vote_digest, DIGEST_LEN)) { + /* Ah, it's the same vote. Not a problem. */ + log_info(LD_DIR, "Discarding a vote we already have."); + *msg_out = "ok"; + goto err; + } else if (v->vote->published < vote->published) { + log_notice(LD_DIR, "Replacing an older pending vote from this " + "directory."); cached_dir_decref(v->vote_body); networkstatus_vote_free(v->vote); v->vote_body = new_cached_dir(tor_strdup(vote_body), |