mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Test: make unit tests use a reasonably live consensus
Cleanup after 24661.
This commit is contained in:
@@ -1448,13 +1448,10 @@ networkstatus_valid_until_is_reasonably_live(time_t valid_until,
|
||||
return (now <= valid_until + REASONABLY_LIVE_TIME);
|
||||
}
|
||||
|
||||
/* XXXX remove this in favor of get_live_consensus. But actually,
|
||||
* leave something like it for bridge users, who need to not totally
|
||||
* lose if they spend a while fetching a new consensus. */
|
||||
/** As networkstatus_get_live_consensus(), but is way more tolerant of expired
|
||||
* consensuses. */
|
||||
networkstatus_t *
|
||||
networkstatus_get_reasonably_live_consensus(time_t now, int flavor)
|
||||
MOCK_IMPL(networkstatus_t *,
|
||||
networkstatus_get_reasonably_live_consensus,(time_t now, int flavor))
|
||||
{
|
||||
networkstatus_t *consensus =
|
||||
networkstatus_get_latest_consensus_by_flavor(flavor);
|
||||
|
||||
@@ -89,8 +89,9 @@ int networkstatus_consensus_reasonably_live(const networkstatus_t *consensus,
|
||||
time_t now);
|
||||
int networkstatus_valid_until_is_reasonably_live(time_t valid_until,
|
||||
time_t now);
|
||||
networkstatus_t *networkstatus_get_reasonably_live_consensus(time_t now,
|
||||
int flavor);
|
||||
MOCK_DECL(networkstatus_t *,networkstatus_get_reasonably_live_consensus,
|
||||
(time_t now,
|
||||
int flavor));
|
||||
MOCK_DECL(int, networkstatus_consensus_is_bootstrapping,(time_t now));
|
||||
int networkstatus_consensus_can_use_multiple_directories(
|
||||
const or_options_t *options);
|
||||
|
||||
Reference in New Issue
Block a user