[tor-commits] [nyx/master] Connection locales don't require descriptors

atagar at torproject.org atagar at torproject.org
Sun Oct 16 17:39:12 UTC 2016


commit a8549caf7a03e46a7fa5d00d0432a217060075be
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri Oct 14 10:55:00 2016 -0700

    Connection locales don't require descriptors
    
    Oops, when descriptors are unavailable we should still resolve geoip
    information.
---
 nyx/panel/connection.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nyx/panel/connection.py b/nyx/panel/connection.py
index cabba2d..344de43 100644
--- a/nyx/panel/connection.py
+++ b/nyx/panel/connection.py
@@ -164,10 +164,10 @@ class ConnectionEntry(Entry):
 
     if self.get_type() in (Category.OUTBOUND, Category.CIRCUIT, Category.DIRECTORY, Category.EXIT):
       fingerprint = nyx.tracker.get_consensus_tracker().get_relay_fingerprints(self._connection.remote_address).get(self._connection.remote_port)
+      locale = tor_controller().get_info('ip-to-country/%s' % self._connection.remote_address, None)
 
       if fingerprint:
         nickname = nyx.tracker.get_consensus_tracker().get_relay_nickname(fingerprint)
-        locale = tor_controller().get_info('ip-to-country/%s' % self._connection.remote_address, None)
 
     return [Line(self, LineType.CONNECTION, self._connection, None, fingerprint, nickname, locale)]
 
@@ -237,8 +237,8 @@ class CircuitEntry(Entry):
       if fingerprint is not None:
         address, port = consensus_tracker.get_relay_address(fingerprint, ('192.168.0.1', 0))
         nickname = consensus_tracker.get_relay_nickname(fingerprint)
-        locale = tor_controller().get_info('ip-to-country/%s' % address, None)
 
+      locale = tor_controller().get_info('ip-to-country/%s' % address, None)
       connection = nyx.tracker.Connection(datetime_to_unix(self._circuit.created), False, '127.0.0.1', 0, address, port, 'tcp', False)
       return Line(self, line_type, connection, self._circuit, fingerprint, nickname, locale)
 





More information about the tor-commits mailing list