summaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 29efcb5083..721e8bee1f 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -1406,8 +1406,6 @@ dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out)
log_info(LD_DIR, "Discarding a vote we already have.");
if (*status_out < 200)
*status_out = 200;
- if (!*msg_out)
- *msg_out = "OK";
goto discard;
} else if (v->vote->published < vote->published) {
log_notice(LD_DIR, "Replacing an older pending vote from this "
@@ -1468,8 +1466,14 @@ dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out)
if (*status_out < 200)
*status_out = 200;
- if (!*msg_out)
- *msg_out = "ok";
+ if (!*msg_out) {
+ if (!any_failed && !pending_vote) {
+ *msg_out = "Duplicate discarded";
+ } else {
+ *msg_out = "ok";
+ }
+ }
+
return any_failed ? NULL : pending_vote;
}