summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2011-05-21 19:23:27 -0400
committerRoger Dingledine <arma@torproject.org>2011-05-21 19:23:27 -0400
commitaf0e8d834e4b1da029f7505745225f848e96def6 (patch)
treeeca0e87e155dc6155324cef7a9a1181a3cc238f7 /src/or/router.c
parent1ba1bdee4bd8f3c00e603fe9b0fd2f14eeb60466 (diff)
downloadtor-af0e8d834e4b1da029f7505745225f848e96def6.tar.gz
tor-af0e8d834e4b1da029f7505745225f848e96def6.zip
don't mark our descriptor dirty if our onion key hasn't changed
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 184715b750..f6728aac91 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -82,6 +82,11 @@ static authority_cert_t *legacy_key_certificate = NULL;
static void
set_onion_key(crypto_pk_env_t *k)
{
+ if (onionkey && !crypto_pk_cmp_keys(onionkey, k)) {
+ /* k is already our onion key; free it and return */
+ crypto_free_pk_env(k);
+ return;
+ }
tor_mutex_acquire(key_lock);
crypto_free_pk_env(onionkey);
onionkey = k;