|  | @@ -845,6 +845,9 @@ run_scheduled_events(time_t now)
 | 
	
		
			
				|  |  |    static time_t time_to_add_entropy = 0;
 | 
	
		
			
				|  |  |    static time_t time_to_write_hs_statistics = 0;
 | 
	
		
			
				|  |  |    static time_t time_to_downrate_stability = 0;
 | 
	
		
			
				|  |  | +  /* XXXX020 this is way too low. */
 | 
	
		
			
				|  |  | +#define SAVE_STABILITY_INTERVAL (10*60)
 | 
	
		
			
				|  |  | +  static time_t time_to_save_stability = 0;
 | 
	
		
			
				|  |  |    or_options_t *options = get_options();
 | 
	
		
			
				|  |  |    int i;
 | 
	
		
			
				|  |  |    int have_dir_info;
 | 
	
	
		
			
				|  | @@ -935,6 +938,22 @@ run_scheduled_events(time_t now)
 | 
	
		
			
				|  |  |    /** 1d. DOCDOC */
 | 
	
		
			
				|  |  |    if (time_to_downrate_stability < now)
 | 
	
		
			
				|  |  |      time_to_downrate_stability = rep_hist_downrate_old_runs(now);
 | 
	
		
			
				|  |  | +  if (authdir_mode_tests_reachability(options)) {
 | 
	
		
			
				|  |  | +    if (!time_to_save_stability)
 | 
	
		
			
				|  |  | +      time_to_save_stability = now + SAVE_STABILITY_INTERVAL;
 | 
	
		
			
				|  |  | +    if (time_to_save_stability < now) {
 | 
	
		
			
				|  |  | +      size_t len = strlen(options->DataDirectory)+32;
 | 
	
		
			
				|  |  | +      char *fn = tor_malloc(len);
 | 
	
		
			
				|  |  | +      tor_snprintf(fn, len, "%s"PATH_SEPARATOR"router-stability",
 | 
	
		
			
				|  |  | +                   options->DataDirectory);
 | 
	
		
			
				|  |  | +      if (rep_hist_record_mtbf_data(fn)<0) {
 | 
	
		
			
				|  |  | +        log_warn(LD_GENERAL, "Couldn't store mtbf data in %s", fn);
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      tor_free(fn);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      time_to_save_stability = now + SAVE_STABILITY_INTERVAL;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /** 2. Periodically, we consider getting a new directory, getting a
 | 
	
		
			
				|  |  |     * new running-routers list, and/or force-uploading our descriptor
 |