aboutsummaryrefslogtreecommitdiff
path: root/src/or/nodelist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-03-17 14:15:12 -0400
committerNick Mathewson <nickm@torproject.org>2014-03-27 14:23:19 -0400
commit0389d4aa561bec06ad2aab70ea5a989f1f2d02c6 (patch)
treea010468c5cb5f55cc6949634aa3356aad8097a68 /src/or/nodelist.c
parentcbf9e742368158b927249913b395b3796d847a92 (diff)
downloadtor-0389d4aa561bec06ad2aab70ea5a989f1f2d02c6.tar
tor-0389d4aa561bec06ad2aab70ea5a989f1f2d02c6.tar.gz
More logs to try to diagnose bug 7164
This time, check in microdesc_cache_clean() to see what could be going wrong with an attempt to clean a microdesc that's held by a node.
Diffstat (limited to 'src/or/nodelist.c')
-rw-r--r--src/or/nodelist.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 178f084b6..d92ef1733 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -337,6 +337,25 @@ nodelist_drop_node(node_t *node, int remove_from_ht)
node->nodelist_idx = -1;
}
+/** Return a newly allocated smartlist of the nodes that have <b>md</b> as
+ * their microdescriptor. */
+smartlist_t *
+nodelist_find_nodes_with_microdesc(const microdesc_t *md)
+{
+ smartlist_t *result = smartlist_new();
+
+ if (the_nodelist == NULL)
+ return result;
+
+ SMARTLIST_FOREACH_BEGIN(the_nodelist->nodes, node_t *, node) {
+ if (node->md == md) {
+ smartlist_add(result, node);
+ }
+ } SMARTLIST_FOREACH_END(node);
+
+ return result;
+}
+
/** Release storage held by <b>node</b> */
static void
node_free(node_t *node)