diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-03-27 14:26:21 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-03-27 14:26:21 -0400 |
commit | 2721246f5d20e34e3f32b3a062f08cedbd15e36d (patch) | |
tree | 98ba4d8532637a0b39e1b627806ada55b82a2713 /src/or/nodelist.c | |
parent | cd15172444e0f8e34d1adcd84034c40893cd6c0f (diff) | |
parent | 0389d4aa561bec06ad2aab70ea5a989f1f2d02c6 (diff) | |
download | tor-2721246f5d20e34e3f32b3a062f08cedbd15e36d.tar.gz tor-2721246f5d20e34e3f32b3a062f08cedbd15e36d.zip |
Merge branch 'bug7164_diagnose_harder_v2'
Diffstat (limited to 'src/or/nodelist.c')
-rw-r--r-- | src/or/nodelist.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 3704822c72..52c92661c0 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -332,6 +332,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) |