aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-12-24 02:45:46 +0000
committerNick Mathewson <nickm@torproject.org>2006-12-24 02:45:46 +0000
commitbba5a3533f1413601c04a8f61ab0662b77fe7e2b (patch)
tree906f5a9e23837b5b7f718d20415802aa8b90494a /src/or/router.c
parenta9dc42e3815ff49f469d37039df83fb2db6fa73e (diff)
downloadtor-bba5a3533f1413601c04a8f61ab0662b77fe7e2b.tar.gz
tor-bba5a3533f1413601c04a8f61ab0662b77fe7e2b.zip
r11679@Kushana: nickm | 2006-12-23 21:38:41 -0500
Update the state file less often when AvoidDiskWrites is set. svn:r9174
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c
index a69cd180e3..a435842056 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -156,7 +156,7 @@ rotate_onion_key(void)
state->LastRotatedOnionKey = onionkey_set_at = now;
tor_mutex_release(key_lock);
mark_my_descriptor_dirty();
- or_state_mark_dirty(state, 0);
+ or_state_mark_dirty(state, get_options()->AvoidDiskWrites ? now+3600 : 0);
return;
error:
log_warn(LD_GENERAL, "Couldn't rotate onion key.");
@@ -308,7 +308,7 @@ init_keys(void)
* start the clock ticking now so that we will eventually rotate it even
* if we don't stay up for a full MIN_ONION_KEY_LIFETIME. */
state->LastRotatedOnionKey = time(NULL);
- or_state_mark_dirty(state, 0);
+ or_state_mark_dirty(state, options->AvoidDiskWrites ? time(NULL)+3600 : 0);
}
tor_snprintf(keydir,sizeof(keydir),"%s/keys/secret_onion_key.old",datadir);