summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorChelsea H. Komlo <chelsea.komlo@gmail.com>2016-11-02 09:45:02 -0500
committerChelsea H. Komlo <chelsea.komlo@gmail.com>2016-11-24 08:12:33 -0500
commit118bba7622ab15ea5c58ff32be178820150423ba (patch)
tree84b46f7a30af14b70b8533102f6b6cb56f72c9dd /src/or/circuituse.c
parentcfb8363da9210ba3df92a0b6a572b8c3c5adcf9b (diff)
downloadtor-118bba7622ab15ea5c58ff32be178820150423ba.tar.gz
tor-118bba7622ab15ea5c58ff32be178820150423ba.zip
Refactor to remove unnecessary check in circuit_is_available_for_use
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 9afe77b77e..6fb4f82b6d 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1033,15 +1033,13 @@ circuit_is_available_for_use(const circuit_t *circ)
const origin_circuit_t *origin_circ;
cpath_build_state_t *build_state;
- if (!CIRCUIT_IS_ORIGIN(circ))
- return 0;
if (circ->marked_for_close)
return 0; /* Don't mess with marked circs */
if (circ->timestamp_dirty)
return 0; /* Only count clean circs */
if (circ->purpose != CIRCUIT_PURPOSE_C_GENERAL)
- return 0;/* Only pay attention to general
- purpose circs */
+ return 0; /* Only pay attention to general purpose circuits.
+ General purpose circuits are always origin circuits. */
origin_circ = CONST_TO_ORIGIN_CIRCUIT(circ);
if (origin_circ->unusable_for_new_conns)