commit 215aac6d30a7c62ef6d1ec1c6c3ef655865db784 Author: Karsten Loesing karsten.loesing@gmx.net Date: Sun Apr 3 13:23:21 2011 +0200
Minor fix that only affects the logs.
Wait with putting the current consensus on the missing list until we start downloading descriptors. We might have learned it before when parsing a local descriptor directory. --- .../ernie/db/RelayDescriptorDownloader.java | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/org/torproject/ernie/db/RelayDescriptorDownloader.java b/src/org/torproject/ernie/db/RelayDescriptorDownloader.java index 190d1ae..835d821 100644 --- a/src/org/torproject/ernie/db/RelayDescriptorDownloader.java +++ b/src/org/torproject/ernie/db/RelayDescriptorDownloader.java @@ -275,14 +275,6 @@ public class RelayDescriptorDownloader { } }
- /* Put the current consensus on the missing list, unless we already - * have it. */ - String consensusKey = "consensus," + this.currentValidAfter; - if (!this.missingDescriptors.containsKey(consensusKey)) { - this.missingDescriptors.put(consensusKey, "NA"); - this.newMissingConsensuses++; - } - /* Read list of directory authorities and when we last downloaded all * server and extra-info descriptors from them. */ this.lastDownloadedAllDescriptors = new HashMap<String, String>(); @@ -453,6 +445,14 @@ public class RelayDescriptorDownloader { */ public void downloadDescriptors() {
+ /* Put the current consensus on the missing list, unless we already + * have it. */ + String consensusKey = "consensus," + this.currentValidAfter; + if (!this.missingDescriptors.containsKey(consensusKey)) { + this.missingDescriptors.put(consensusKey, "NA"); + this.newMissingConsensuses++; + } + /* Download descriptors from authorities which are in random order, so * that we distribute the load somewhat fairly over time. */ for (String authority : authorities) { @@ -469,7 +469,6 @@ public class RelayDescriptorDownloader { /* Start with downloading the current consensus, unless we already * have it. */ if (downloadCurrentConsensus) { - String consensusKey = "consensus," + this.currentValidAfter; if (this.missingDescriptors.containsKey(consensusKey) && this.missingDescriptors.get(consensusKey).equals("NA")) { this.requestedConsensuses++;
tor-commits@lists.torproject.org