Commit 3a8f5ed3 authored by Nick Mathewson's avatar Nick Mathewson 🥔
Browse files

guardmgr: flag to indicate whether a FirstHop is a Bridge

This will affect some details of path selection as we provide more
info about families.
parent bda100d9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1688,6 +1688,15 @@ impl FirstHop {
        }
    }

    /// Return true if this guard is a bridge.
    pub fn is_bridge(&self) -> bool {
        match &self.sample {
            #[cfg(feature = "bridge-client")]
            Some(s) if s.universe_type() == UniverseType::BridgeSet => true,
            _ => false,
        }
    }

    /// If possible, return a view of this object that can be used to build a circuit.
    pub fn as_circ_target(&self) -> Option<&OwnedCircTarget> {
        match &self.inner {