aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerlist.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-08-09 13:47:42 -0400
committerNick Mathewson <nickm@torproject.org>2012-08-09 14:15:58 -0400
commit07df4dd52d3ab2eea2e8a8fc3222a5d297d077de (patch)
treeb11ca0fc673180ab78d37d699f6e1e3790735d7d /src/or/routerlist.h
parent9bfb274abb9f9e5d445a75f0b67b433be823a730 (diff)
downloadtor-07df4dd52d3ab2eea2e8a8fc3222a5d297d077de.tar
tor-07df4dd52d3ab2eea2e8a8fc3222a5d297d077de.tar.gz
Refactor the core of choosing by weights into a function
This eliminates duplicated code, and lets us test a hairy piece of functionality.
Diffstat (limited to 'src/or/routerlist.h')
-rw-r--r--src/or/routerlist.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/routerlist.h b/src/or/routerlist.h
index 8dcc6eb02..0b9b29751 100644
--- a/src/or/routerlist.h
+++ b/src/or/routerlist.h
@@ -216,5 +216,10 @@ int hex_digest_nickname_decode(const char *hexdigest,
char *nickname_qualifier_out,
char *nickname_out);
+#ifdef ROUTERLIST_PRIVATE
+int choose_array_element_by_weight(const uint64_t *entries, int n_entries,
+ uint64_t *total_out);
+#endif
+
#endif