[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] relaylist: add method to check and exit has some flags



commit 5796572a204c9723a165de7eb2d7fe471d41fcd8
Author: juga0 <juga@xxxxxxxxxx>
Date:   Thu Nov 22 14:21:10 2018 +0000

    relaylist: add method to check and exit has some flags
    
    The flags are: not having a badexit and the policy allows to exit
    to a port.
---
 sbws/lib/relaylist.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sbws/lib/relaylist.py b/sbws/lib/relaylist.py
index 9d5c050..979ae7f 100644
--- a/sbws/lib/relaylist.py
+++ b/sbws/lib/relaylist.py
@@ -138,6 +138,11 @@ class Relay:
             return False
         return self.exit_policy.can_exit_to(port=port)
 
+    def is_exit_not_bad_allowing_port(self, port):
+        return (Flag.BADEXIT not in self.flags and
+                Flag.EXIT in self.flags and
+                self.can_exit_to_port(port))
+
 
 class RelayList:
     ''' Keeps a list of all relays in the current Tor network and updates it



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits