{
if (!networkstatus_get_latest_consensus())
return NULL;
- return smartlist_bsearch(networkstatus_get_latest_consensus()->routerstatus_list, digest,
+ const smartlist_t *rslist;
+ rslist = networkstatus_get_latest_consensus()->routerstatus_list;
+ return smartlist_bsearch(rslist, digest,
compare_digest_to_routerstatus_entry);
}
const int is_usable_flavor = flav == usable_consensus_flavor();
if (is_usable_flavor) {
- notify_control_networkstatus_changed(networkstatus_get_latest_consensus(), c);
+ notify_control_networkstatus_changed(
+ networkstatus_get_latest_consensus(), c);
}
if (flav == FLAV_NS) {
if (current_ns_consensus) {
networkstatus_copy_old_consensus_info(c, current_ns_consensus);
networkstatus_vote_free(current_ns_consensus);
- /* Defensive programming : we should set networkstatus_get_latest_consensus() very soon,
+ /* Defensive programming : we should set current_ns_consensus very soon
* but we're about to call some stuff in the meantime, and leaving this
* dangling pointer around has proven to be trouble. */
current_ns_consensus = NULL;
named_server_map = strmap_new();
strmap_free(unnamed_server_map, NULL);
unnamed_server_map = strmap_new();
- SMARTLIST_FOREACH_BEGIN(networkstatus_get_latest_consensus()->routerstatus_list,
+ const smartlist_t *rslist;
+ rslist = networkstatus_get_latest_consensus()->routerstatus_list;
+ SMARTLIST_FOREACH_BEGIN(rslist,
const routerstatus_t *, rs) {
if (rs->is_named) {
strmap_set_lc(named_server_map, rs->nickname,