summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ransom <rransom.8774@gmail.com>2012-06-14 15:41:11 +0000
committerNick Mathewson <nickm@torproject.org>2012-08-03 11:45:33 -0400
commit82c5e385cbddec4fd80618d6e96111ad73d5a22e (patch)
tree84f2fc784894b1af752a11faf569be9d03479a51
parent1040afb2425a8056dc41b35e6d825fc329663ee6 (diff)
downloadtor-82c5e385cbddec4fd80618d6e96111ad73d5a22e.tar.gz
tor-82c5e385cbddec4fd80618d6e96111ad73d5a22e.zip
Remove bogus comment claiming that an assertion is triggerable by consensus
-rw-r--r--src/or/routerlist.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index de1a66ce16..37de70f0b5 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1983,9 +1983,10 @@ smartlist_choose_node_by_bandwidth(smartlist_t *sl,
if (is_guard)
bitarray_set(guard_bits, i);
if (is_known) {
- bandwidths[i] = (int32_t) this_bw; // safe since MAX_BELIEVABLE<INT32_MAX
- // XXX this is no longer true! We don't always cap the bw anymore. Can
- // a consensus make us overflow?-sh
+ bandwidths[i] = (int32_t) this_bw;
+ /* Casting this_bw to int32_t is safe because both kb_to_bytes
+ and bridge_get_advertised_bandwidth_bounded limit it to below
+ INT32_MAX. */
tor_assert(bandwidths[i] >= 0);
if (is_guard)
total_guard_bw += this_bw;