aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/relay_find_addr.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-09-18 13:07:11 -0400
committerNick Mathewson <nickm@torproject.org>2020-11-17 07:58:26 -0500
commitbc5f26ff7006f50acd23f9eb1a99449612b95198 (patch)
treef6eebcef8fb70c423a83e318371b071baa4396c1 /src/feature/relay/relay_find_addr.h
parenta5538a36037641e49ca05aa3e90fec256794412b (diff)
downloadtor-bc5f26ff7006f50acd23f9eb1a99449612b95198.tar.gz
tor-bc5f26ff7006f50acd23f9eb1a99449612b95198.zip
relay: Launch dummy circuit only when descriptor build fails
First, this commit moves the launch_dummy_circuit_as_needed() function into relay_find_addr.c and renames it to relay_addr_learn_from_dirauth(). This is an attempt to centralize anything relate with address discovery in the right module. Second, when building a descriptor and we fail to discover our address, immediately launch a dummy circuit to an authority in an attempt to learn our descriptor. It is still only done every 20 minutes even though the descriptor build is done every minute. We ought to avoid load on the authority and if we can't learn in the first place our address from them, chances are more things are wrong. Related to #40071 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/relay/relay_find_addr.h')
-rw-r--r--src/feature/relay/relay_find_addr.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/feature/relay/relay_find_addr.h b/src/feature/relay/relay_find_addr.h
index 3d30946b05..34890cd34e 100644
--- a/src/feature/relay/relay_find_addr.h
+++ b/src/feature/relay/relay_find_addr.h
@@ -24,6 +24,8 @@ MOCK_DECL(bool, relay_find_addr_to_publish,
bool relay_has_address_set(int family);
+void relay_addr_learn_from_dirauth(void);
+
#ifdef RELAY_FIND_ADDR_PRIVATE
#endif /* RELAY_FIND_ADDR_PRIVATE */