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

[tor-commits] [stem/master] Skip internal circuits in exit_used.py example



commit 57364fae7269ec562c5fc8cdb073ff9463d9a0f0
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Thu Nov 18 14:00:32 2021 -0800

    Skip internal circuits in exit_used.py example
    
    pragma31 made the good point that exit_used.py confusingly presents the
    internal 1-hop circuits for fetching descriptors. Filtering those out.
    
      https://github.com/torproject/stem/pull/111
---
 docs/_static/example/exit_used.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/_static/example/exit_used.py b/docs/_static/example/exit_used.py
index 4462620e..405425e4 100644
--- a/docs/_static/example/exit_used.py
+++ b/docs/_static/example/exit_used.py
@@ -1,6 +1,6 @@
 import functools
 
-from stem import StreamStatus
+from stem import CircBuildFlag, StreamStatus
 from stem.control import EventType, Controller
 
 
@@ -21,6 +21,9 @@ async def stream_event(controller, event):
   if event.status == StreamStatus.SUCCEEDED and event.circ_id:
     circ = await controller.get_circuit(event.circ_id)
 
+    if CircBuildFlag.IS_INTERNAL in circ.build_flags:
+      return
+
     exit_fingerprint = circ.path[-1][0]
     exit_relay = await controller.get_network_status(exit_fingerprint)
 

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