[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [metrics-db/master 2/2] Don't add vote status entries to the database.
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Sat, 18 Sep 2010 19:31:19 +0200
Subject: Don't add vote status entries to the database.
Commit: 2eb82832c8fcd66f78e69271f5efa0bb9be05e62
---
.../torproject/ernie/db/RelayDescriptorParser.java | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/org/torproject/ernie/db/RelayDescriptorParser.java b/src/org/torproject/ernie/db/RelayDescriptorParser.java
index c8a2621..07e6a90 100644
--- a/src/org/torproject/ernie/db/RelayDescriptorParser.java
+++ b/src/org/torproject/ernie/db/RelayDescriptorParser.java
@@ -150,7 +150,8 @@ public class RelayDescriptorParser {
} else if (line.startsWith("fingerprint ")) {
fingerprint = line.split(" ")[1];
} else if (line.startsWith("r ")) {
- if (relayIdentity != null && this.rddi != null) {
+ if (isConsensus && relayIdentity != null &&
+ this.rddi != null) {
byte[] rawDescriptor = rawStatusEntry.toString().getBytes();
this.rddi.addStatusEntry(validAfter, nickname,
relayIdentity, serverDesc, published, address, orPort,
@@ -214,18 +215,18 @@ public class RelayDescriptorParser {
ports = line.substring(2);
}
}
- if (relayIdentity != null && this.rddi != null) {
- byte[] rawDescriptor = rawStatusEntry.toString().getBytes();
- this.rddi.addStatusEntry(validAfter, nickname,
- relayIdentity, serverDesc, published, address, orPort,
- dirPort, relayFlags, version, bandwidth, ports,
- rawDescriptor);
- }
if (isConsensus) {
+ if (relayIdentity != null && this.rddi != null) {
+ byte[] rawDescriptor = rawStatusEntry.toString().getBytes();
+ this.rddi.addStatusEntry(validAfter, nickname,
+ relayIdentity, serverDesc, published, address, orPort,
+ dirPort, relayFlags, version, bandwidth, ports,
+ rawDescriptor);
+ }
if (this.bsfh != null) {
for (String hashedRelayIdentity : hashedRelayIdentities) {
this.bsfh.addHashedRelay(hashedRelayIdentity);
- }
+ }
}
if (this.csfh != null) {
this.csfh.addConsensusResults(validAfterTime, exit, fast,
--
1.7.1