From 68819a084f60eb2e0453f21ac6986a15e2217d5b Mon Sep 17 00:00:00 2001 From: Karsten Loesing Date: Tue, 19 Sep 2017 12:06:33 +0200 Subject: [PATCH] Fix the "running" field in bridge details documents. When we set this field in the update process, we only looked whether the bridge is contained in the last known bridge network status. We also need to check whether it has the "Running" flag assigned there. This is different from relays, because the consensus only lists relays with the "Running" flag since a couple of years, whereas the bridge network status lists all known bridges. Fixes #23467. Spotted by nusenu. --- CHANGELOG.md | 5 +++++ .../torproject/onionoo/updater/NodeDetailsStatusUpdater.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f817060d..b9a171d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changes in version 4.?-?.?.? - 2017-??-?? + * Medium changes + - Only set the "running" field in a bridge's details document to + true if the bridge is both contained in the last known bridge + network status and has the "Running" flag assigned there. + * Minor changes - Remove placeholder page on index.html. diff --git a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java index 9fcff35e..ff14d758 100644 --- a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java +++ b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java @@ -863,7 +863,8 @@ public class NodeDetailsStatusUpdater implements DescriptorListener, } detailsStatus.setRelay(nodeStatus.isRelay()); - detailsStatus.setRunning(nodeStatus.getLastSeenMillis() + detailsStatus.setRunning(nodeStatus.getRelayFlags().contains("Running") + && nodeStatus.getLastSeenMillis() == (nodeStatus.isRelay() ? this.relaysLastValidAfterMillis : this.bridgesLastPublishedMillis)); detailsStatus.setNickname(nodeStatus.getNickname()); -- GitLab