Skip to content

Commit

Permalink
refactor(dcutr): don't use OutboundOpenInfo
Browse files Browse the repository at this point in the history
In a previous refactoring, we actually removed the usage of this openinfo so this is just removing dead code.

Related: #3268.

Pull-Request: #3762.
  • Loading branch information
thomaseizinger authored Apr 28, 2023
1 parent a836bb4 commit 66466c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions protocols/dcutr/src/behaviour_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ impl Behaviour {
handler: NotifyHandler::One(connection_id),
event: Either::Left(handler::relayed::Command::Connect {
obs_addrs: self.observed_addreses(),
attempt: 1,
}),
},
ToSwarm::GenerateEvent(Event::InitiatedDirectConnectionUpgrade {
Expand Down Expand Up @@ -190,7 +189,6 @@ impl Behaviour {
handler: NotifyHandler::One(relayed_connection_id),
peer_id,
event: Either::Left(handler::relayed::Command::Connect {
attempt: attempt + 1,
obs_addrs: self.observed_addreses(),
}),
})
Expand Down
10 changes: 4 additions & 6 deletions protocols/dcutr/src/handler/relayed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ use std::time::Duration;
pub enum Command {
Connect {
obs_addrs: Vec<Multiaddr>,
attempt: u8,
},
AcceptInboundConnect {
obs_addrs: Vec<Multiaddr>,
Expand All @@ -59,10 +58,9 @@ pub enum Command {
impl fmt::Debug for Command {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Command::Connect { obs_addrs, attempt } => f
Command::Connect { obs_addrs } => f
.debug_struct("Command::Connect")
.field("obs_addrs", obs_addrs)
.field("attempt", attempt)
.finish(),
Command::AcceptInboundConnect {
obs_addrs,
Expand Down Expand Up @@ -301,7 +299,7 @@ impl ConnectionHandler for Handler {
>;
type InboundProtocol = Either<protocol::inbound::Upgrade, DeniedUpgrade>;
type OutboundProtocol = protocol::outbound::Upgrade;
type OutboundOpenInfo = u8; // Number of upgrade attempts.
type OutboundOpenInfo = ();
type InboundOpenInfo = ();

fn listen_protocol(&self) -> SubstreamProtocol<Self::InboundProtocol, Self::InboundOpenInfo> {
Expand All @@ -322,12 +320,12 @@ impl ConnectionHandler for Handler {

fn on_behaviour_event(&mut self, event: Self::InEvent) {
match event {
Command::Connect { obs_addrs, attempt } => {
Command::Connect { obs_addrs } => {
self.queued_events
.push_back(ConnectionHandlerEvent::OutboundSubstreamRequest {
protocol: SubstreamProtocol::new(
protocol::outbound::Upgrade::new(obs_addrs),
attempt,
(),
),
});
}
Expand Down

0 comments on commit 66466c4

Please sign in to comment.