Skip to content

Commit 7a3b309

Browse files
maxholmanclaude
andcommitted
fix(relay): remove unused bridge_channels to fix slim dead-code error
The old bridge_channels was replaced by relay_bridge_channels but not removed, causing -D dead-code failure in slim builds where auto mode (the only other potential caller) is not compiled. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b2f157f commit 7a3b309

1 file changed

Lines changed: 0 additions & 38 deletions

File tree

crates/daemon/src/transport.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -107,44 +107,6 @@ where
107107
}
108108
}
109109

110-
/// Bridge a peer connection's channels to source mpsc channels.
111-
///
112-
/// Forwards instructions from the peer to the source (fan-in: N peers → 1 source).
113-
/// Registers the peer's response sender with the fan-out task for the source.
114-
/// Holds the control channel sender alive for the lifetime of the bridged connection.
115-
///
116-
/// `fanout_register_tx` is a channel to the relay's fan-out task: each new
117-
/// peer sends its `responses_tx` there so the fan-out task can include it.
118-
pub(crate) fn bridge_channels(
119-
peer_addr: &str,
120-
peer_instructions_rx: mpsc::Receiver<wallhack_wire::data::EntryNodeInstruction>,
121-
peer_responses_tx: mpsc::Sender<wallhack_wire::data::ExitNodeResponse>,
122-
control_tx: tokio::sync::mpsc::Sender<wallhack_wire::control::ControlMessage>,
123-
source_instr_tx: mpsc::Sender<wallhack_wire::data::EntryNodeInstruction>,
124-
fanout_register_tx: &mpsc::UnboundedSender<mpsc::Sender<wallhack_wire::data::ExitNodeResponse>>,
125-
) {
126-
tracing::debug!("Bridging peer connection: {peer_addr}");
127-
128-
// Register this peer's response sender with the fan-out task.
129-
if fanout_register_tx.send(peer_responses_tx).is_err() {
130-
tracing::warn!("Fan-out task closed, dropping peer {peer_addr}");
131-
return;
132-
}
133-
134-
// Forward peer instructions to source (fan-in).
135-
// Also holds control_tx to keep the control stream alive.
136-
let mut instructions_rx = peer_instructions_rx;
137-
tokio::spawn(async move {
138-
let _keep_alive = control_tx;
139-
while let Some(instr) = instructions_rx.recv().await {
140-
if source_instr_tx.send(instr).await.is_err() {
141-
tracing::warn!("Source instruction channel closed");
142-
break;
143-
}
144-
}
145-
});
146-
}
147-
148110
/// Bridge a relay exit-peer connection's channels to source mpsc channels.
149111
///
150112
/// Registers the exit peer's instruction sender with the instruction fan-out

0 commit comments

Comments
 (0)