summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2010-02-24 11:17:31 -0800
committerMike Perry <mikeperry-git@fscked.org>2010-02-24 11:17:31 -0800
commit0da26162a322f5be4ee0132253b75e765b6193a0 (patch)
tree49b3c2631fd65d1554bef8c54321d6a9b5ea2544
parent4311318f7d598a57fde7e7041069faf55fceb046 (diff)
downloadtor-0da26162a322f5be4ee0132253b75e765b6193a0.tar.gz
tor-0da26162a322f5be4ee0132253b75e765b6193a0.zip
Make unit tests work.
Still not sure why they generate an empty consensus document.. Too much frobbing going on there.
-rw-r--r--src/or/dirvote.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 50c6261eb6..607ea8f5ff 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -751,6 +751,14 @@ networkstatus_compute_bw_weights_v9(smartlist_t *chunks, int64_t G, int64_t M,
char buf[512];
int r;
+ if (G <= 0 || M <= 0 || E <= 0 || D <= 0) {
+ log_warn(LD_DIR, "Consensus with empty bandwidth: "
+ "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT
+ " D="I64_FORMAT" T="I64_FORMAT,
+ G, M, E, D, T);
+ return;
+ }
+
/*
* Computed from cases in 3.4.3 of dir-spec.txt
*