Skip to content

Commit 97b41a1

Browse files
maxholmanclaude
andcommitted
refactor(transport): remove unused role_transition channel
The role_transition_tx field was always None at every construction site. The RoleTransition message is still decoded and logged but no longer forwarded through a channel that nothing reads. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7582823 commit 97b41a1

5 files changed

Lines changed: 0 additions & 16 deletions

File tree

crates/core/src/client/quic/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ impl Client for QuicClient {
181181
handshake_tx: Some(handshake_tx),
182182
latency_tx: Some(latency_tx),
183183
control_response_tx: None,
184-
role_transition_tx: None,
185184
peer_registry: None,
186185
};
187186
match protocol::run_control_stream_initiator(

crates/core/src/client/ws/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ impl WsClient {
398398
handshake_tx: Some(handshake_tx), // receive server's Handshake
399399
latency_tx: Some(latency_tx),
400400
control_response_tx: None,
401-
role_transition_tx: None,
402401
peer_registry: None,
403402
};
404403
match protocol::run_control_stream_initiator(

crates/core/src/server/quic/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ impl Server for QuicServer {
228228
handshake_tx: None, // Handshake already read above
229229
latency_tx: Some(latency_tx),
230230
control_response_tx: None, // server doesn't issue ControlRequests
231-
role_transition_tx: None,
232231
peer_registry: Some(peer_registry),
233232
};
234233
let mut control_stream =

crates/core/src/server/ws/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ impl Server for WebSocketServer {
309309
handshake_tx: None, // Handshake already read above
310310
latency_tx: Some(latency_tx),
311311
control_response_tx: None, // server doesn't issue ControlRequests
312-
role_transition_tx: None,
313312
peer_registry: Some(peer_registry),
314313
};
315314
let mut control_stream =

crates/core/src/transport/protocol.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ pub struct ControlChannels {
141141
pub latency_tx: Option<mpsc::Sender<f64>>,
142142
/// `ControlResponse` forwarding (client side, for correlating requests).
143143
pub control_response_tx: Option<mpsc::Sender<wallhack_wire::control::ControlResponse>>,
144-
/// `RoleTransition` forwarding to the mode task for re-evaluation.
145-
pub role_transition_tx: Option<mpsc::Sender<wallhack_wire::control::RoleTransition>>,
146144
/// Peer registry for handling relay `PeerAnnouncement` messages.
147145
/// Announced peers are registered/unregistered directly in the registry.
148146
pub peer_registry: Option<std::sync::Arc<crate::control::peers::Registry>>,
@@ -292,9 +290,6 @@ impl ControlChannels {
292290
}
293291
Some(control_message::Message::RoleTransition(rt)) => {
294292
tracing::info!("Control: received RoleTransition: {:?}", rt.new_role());
295-
if let Some(ref tx) = self.role_transition_tx {
296-
let _ = tx.send(rt).await;
297-
}
298293
}
299294
Some(control_message::Message::PeerAnnouncement(announcement)) => {
300295
use wallhack_wire::control::peer_announcement;
@@ -708,7 +703,6 @@ mod tests {
708703
handshake_tx: Some(a_hs_tx),
709704
latency_tx: None,
710705
control_response_tx: None,
711-
role_transition_tx: None,
712706
peer_registry: None,
713707
};
714708
let mut stream_a = BoxBiStream::new(stream_a);
@@ -723,7 +717,6 @@ mod tests {
723717
handshake_tx: Some(b_hs_tx),
724718
latency_tx: None,
725719
control_response_tx: None,
726-
role_transition_tx: None,
727720
peer_registry: None,
728721
};
729722
let mut stream_b = BoxBiStream::new(stream_b);
@@ -778,7 +771,6 @@ mod tests {
778771
handshake_tx: Some(hs_tx),
779772
latency_tx: None,
780773
control_response_tx: None,
781-
role_transition_tx: None,
782774
peer_registry: None,
783775
};
784776

@@ -806,7 +798,6 @@ mod tests {
806798
handshake_tx: None,
807799
latency_tx: Some(latency_tx),
808800
control_response_tx: None,
809-
role_transition_tx: None,
810801
peer_registry: None,
811802
};
812803

@@ -888,7 +879,6 @@ mod tests {
888879
handshake_tx: None,
889880
latency_tx: None,
890881
control_response_tx: None,
891-
role_transition_tx: None,
892882
peer_registry: None,
893883
};
894884

@@ -962,7 +952,6 @@ mod tests {
962952
handshake_tx: None,
963953
latency_tx: None,
964954
control_response_tx: None,
965-
role_transition_tx: None,
966955
peer_registry: None,
967956
};
968957

@@ -1094,7 +1083,6 @@ mod tests {
10941083
handshake_tx: None,
10951084
latency_tx: None,
10961085
control_response_tx: None,
1097-
role_transition_tx: None,
10981086
peer_registry: None,
10991087
};
11001088

0 commit comments

Comments
 (0)