Skip to content

Commit

Permalink
fix: use default DialConditions unless explicitly required
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuef committed Nov 29, 2023
1 parent 543408b commit 89504b3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions protocols/kad/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,7 @@ where
}
kbucket::InsertResult::Pending { disconnected } => {
self.queued_events.push_back(ToSwarm::Dial {
opts: DialOpts::peer_id(disconnected.into_preimage())
.condition(dial_opts::PeerCondition::NotDialing)
.build(),
opts: DialOpts::peer_id(disconnected.into_preimage()).build(),
});
RoutingUpdate::Pending
}
Expand Down Expand Up @@ -1311,7 +1309,6 @@ where
if !self.connected_peers.contains(disconnected.preimage()) {
self.queued_events.push_back(ToSwarm::Dial {
opts: DialOpts::peer_id(disconnected.into_preimage())
.condition(dial_opts::PeerCondition::NotDialing)
.build(),
})
}
Expand Down Expand Up @@ -2517,9 +2514,7 @@ where
} else if &peer_id != self.kbuckets.local_key().preimage() {
query.inner.pending_rpcs.push((peer_id, event));
self.queued_events.push_back(ToSwarm::Dial {
opts: DialOpts::peer_id(peer_id)
.condition(dial_opts::PeerCondition::NotDialing)
.build(),
opts: DialOpts::peer_id(peer_id).build(),
});
}
}
Expand Down

0 comments on commit 89504b3

Please sign in to comment.