Skip to content

Commit daa226f

Browse files
plebhashShourya742
authored andcommitted
remove processing_queued_sv1_handshake_responses dead code
became obsolete after previous commit
1 parent c69a5c3 commit daa226f

2 files changed

Lines changed: 1 addition & 27 deletions

File tree

miner-apps/translator/src/lib/sv1/downstream/downstream.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ pub struct Downstream {
4949
pub downstream_channel_state: DownstreamChannelState,
5050
// Flag to track if SV1 handshake is complete (subscribe + authorize)
5151
pub sv1_handshake_complete: Arc<AtomicBool>,
52-
// Flag to indicate we're processing queued Sv1 handshake message responses
53-
pub processing_queued_sv1_handshake_responses: Arc<AtomicBool>,
5452
}
5553

5654
#[cfg_attr(not(test), hotpath::measure_all)]
@@ -84,7 +82,6 @@ impl Downstream {
8482
downstream_data,
8583
downstream_channel_state,
8684
sv1_handshake_complete: Arc::new(AtomicBool::new(false)),
87-
processing_queued_sv1_handshake_responses: Arc::new(AtomicBool::new(false)),
8885
}
8986
}
9087

@@ -201,11 +198,6 @@ impl Downstream {
201198
return Ok(()); // Message not intended for this downstream
202199
}
203200

204-
// Check if this is a queued message response
205-
let is_queued_sv1_handshake_response = self
206-
.processing_queued_sv1_handshake_responses
207-
.load(Ordering::SeqCst);
208-
209201
// Handle messages based on message type and handshake state
210202
if let Message::Notification(notification) = &message {
211203
// For notifications (mining.set_difficulty, mining.notify), only send if
@@ -328,22 +320,8 @@ impl Downstream {
328320
}
329321
}
330322
}
331-
} else if is_queued_sv1_handshake_response {
332-
// For non-notification messages, send if processing queued handshake responses
333-
self.downstream_channel_state
334-
.downstream_sv1_sender
335-
.send(message.clone())
336-
.await
337-
.map_err(|e| {
338-
error!("Down: Failed to send queued message to downstream: {:?}", e);
339-
TproxyError::disconnect(
340-
TproxyErrorKind::ChannelErrorSender,
341-
downstream_id.unwrap_or(0),
342-
)
343-
})?;
344323
} else {
345-
// Neither handshake complete nor queued response - skip non-notification
346-
// messages
324+
// Handshake not complete - skip non-notification messages.
347325
debug!("Down: SV1 handshake not complete, skipping non-notification message");
348326
}
349327
}

miner-apps/translator/src/lib/sv1/sv1_server/sv1_server.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,6 @@ impl Sv1Server {
584584
downstream_id
585585
);
586586

587-
// Set flag to indicate we're processing queued responses
588-
downstream
589-
.processing_queued_sv1_handshake_responses
590-
.store(true, Ordering::SeqCst);
591587
let downstream_sv1_sender = downstream
592588
.downstream_channel_state
593589
.downstream_sv1_sender

0 commit comments

Comments
 (0)