From 09d443151f10b00b262f485e4dd53fc671f2692b Mon Sep 17 00:00:00 2001 From: Benno Zeeman Date: Tue, 11 Jul 2023 12:01:25 +0200 Subject: [PATCH] feat(swarm): use NotDialing condition by default --- swarm/CHANGELOG.md | 5 +++++ swarm/src/dial_opts.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/swarm/CHANGELOG.md b/swarm/CHANGELOG.md index 12b2856e9a0..cb7f0c51689 100644 --- a/swarm/CHANGELOG.md +++ b/swarm/CHANGELOG.md @@ -1,5 +1,10 @@ ## 0.43.1 - unreleased +- Change the default `PeerCondition` to `NotDialing`. This will prevent multiple simultaneous dials to the same peer, by default. + See [PR 4185]. + +[PR 4185]: https://github.com/libp2p/rust-libp2p/pull/4185 + - Do not announce external address candidate before address translation, unless translation does not apply. This will prevent ephemeral TCP addresses being announced as external address candidates. See [PR 4158]. diff --git a/swarm/src/dial_opts.rs b/swarm/src/dial_opts.rs index 9be7280b3df..4c24e3c8483 100644 --- a/swarm/src/dial_opts.rs +++ b/swarm/src/dial_opts.rs @@ -313,11 +313,11 @@ pub enum PeerCondition { /// A new dialing attempt is initiated _only if_ the peer is currently /// considered disconnected, i.e. there is no established connection /// and no ongoing dialing attempt. - #[default] Disconnected, /// A new dialing attempt is initiated _only if_ there is currently /// no ongoing dialing attempt, i.e. the peer is either considered /// disconnected or connected but without an ongoing dialing attempt. + #[default] NotDialing, /// A new dialing attempt is always initiated, only subject to the /// configured connection limits.