diff options
author | Neel Chauhan <neel@neelc.org> | 2019-04-11 20:44:30 -0400 |
---|---|---|
committer | Neel Chauhan <neel@neelc.org> | 2019-04-11 20:44:30 -0400 |
commit | 4172dcaa62b02593910736110d9d2c94052dbdcb (patch) | |
tree | 33e78ed27f44153c0c578a337d1f8bc938e3a763 /src/feature/dirauth/voteflags.c | |
parent | e16f5184dad6d0052df37496327e2652d9c79d00 (diff) | |
download | tor-4172dcaa62b02593910736110d9d2c94052dbdcb.tar.gz tor-4172dcaa62b02593910736110d9d2c94052dbdcb.zip |
Move code for setting bridges as running to voteflags.c
Diffstat (limited to 'src/feature/dirauth/voteflags.c')
-rw-r--r-- | src/feature/dirauth/voteflags.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/feature/dirauth/voteflags.c b/src/feature/dirauth/voteflags.c index 0a53c588d6..4040f162fa 100644 --- a/src/feature/dirauth/voteflags.c +++ b/src/feature/dirauth/voteflags.c @@ -29,6 +29,7 @@ #include "feature/nodelist/node_st.h" #include "feature/nodelist/routerinfo_st.h" +#include "feature/nodelist/routerlist_st.h" #include "feature/nodelist/vote_routerstatus_st.h" #include "lib/container/order.h" @@ -658,3 +659,20 @@ dirserv_set_routerstatus_testing(routerstatus_t *rs) rs->is_hs_dir = 0; } } + +/** Use dirserv_set_router_is_running() to set bridges as running if they're + * reachable. + * + * This function is called from set_bridge_running_callback() when running as + * a bridge authority. + */ +void +dirserv_set_bridges_running(time_t now) +{ + routerlist_t *rl = router_get_routerlist(); + + SMARTLIST_FOREACH_BEGIN(rl->routers, routerinfo_t *, ri) { + if (ri->purpose == ROUTER_PURPOSE_BRIDGE) + dirserv_set_router_is_running(ri, now); + } SMARTLIST_FOREACH_END(ri); +} |