]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
dir auths write consensuses to disk after creation
authorRoger Dingledine <arma@torproject.org>
Sat, 16 Jan 2021 21:23:31 +0000 (16:23 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Thu, 21 Jan 2021 18:46:56 +0000 (13:46 -0500)
This step happens after we make each consensus flavor, and before we
worry about sigs or anything. That way if Tor crashes, or if we fail to
get enough sigs, we still have a chance to know what consensus we wanted
to make.

src/feature/dirauth/dirvote.c

index 6824af815f01098fec76af236ca22d7f1d22b9d4..cf1135ba37e91fdd3a792bdb681b9259f7b5f7f5 100644 (file)
@@ -3462,6 +3462,15 @@ dirvote_compute_consensuses(void)
       pending[flav].body = consensus_body;
       pending[flav].consensus = consensus;
       n_generated++;
+
+      /* Write it out to disk too, for dir auth debugging purposes */
+      {
+        char *filename;
+        tor_asprintf(&filename, "my-consensus-%s", flavor_name);
+        write_str_to_file(get_datadir_fname(filename), consensus_body, 0);
+        tor_free(filename);
+      }
+
       consensus_body = NULL;
       consensus = NULL;
     }