[tor-commits] [onionoo/master] Take out some useless code.

karsten at torproject.org karsten at torproject.org
Mon Apr 2 16:27:54 UTC 2012


commit 555c6404f21d8fae643fde077a1d1ad158047935
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Mon Apr 2 18:24:01 2012 +0200

    Take out some useless code.
    
    All details files with descriptor details now contain a last_restarted
    field, and if they don't contain descriptor details we won't be able to
    write a last_restarted line anyway.
---
 src/org/torproject/onionoo/DetailDataWriter.java |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/src/org/torproject/onionoo/DetailDataWriter.java b/src/org/torproject/onionoo/DetailDataWriter.java
index 1420297..c18f7d2 100644
--- a/src/org/torproject/onionoo/DetailDataWriter.java
+++ b/src/org/torproject/onionoo/DetailDataWriter.java
@@ -217,7 +217,6 @@ public class DetailDataWriter {
       /* Read details file for this relay if it exists. */
       String descriptorParts = null;
       long publishedMillis = -1L;
-      boolean containsLastRestartedLine = false;
       if (result.containsKey(fingerprint)) {
         File detailsFile = result.remove(fingerprint);
         try {
@@ -233,8 +232,6 @@ public class DetailDataWriter {
                   "\"desc_published\":\"1970-01-01 00:00:00".length());
               publishedMillis = dateTimeFormat.parse(published).getTime();
               copyDescriptorParts = true;
-            } else if (line.startsWith("\"last_restarted\":")) {
-              containsLastRestartedLine = true;
             }
             if (copyDescriptorParts) {
               sb.append(line + "\n");
@@ -264,8 +261,7 @@ public class DetailDataWriter {
        * line. */
       if (this.relayServerDescriptors.containsKey(fingerprint) &&
           (this.relayServerDescriptors.get(fingerprint).
-          getPublishedMillis() > publishedMillis ||
-          !containsLastRestartedLine)) {
+          getPublishedMillis() > publishedMillis)) {
         ServerDescriptor descriptor = this.relayServerDescriptors.get(
             fingerprint);
         StringBuilder sb = new StringBuilder();



More information about the tor-commits mailing list