Skip to content

Commit

Permalink
Port allow block list and connection limits
Browse files Browse the repository at this point in the history
  • Loading branch information
umgefahren committed Dec 27, 2023
1 parent 596bb06 commit 37cd309
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions misc/allow-block-list/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
//! # }
//! ```

use libp2p_core::transport::PortUse;
use libp2p_core::{Endpoint, Multiaddr};
use libp2p_identity::PeerId;
use libp2p_swarm::{
Expand Down Expand Up @@ -225,6 +226,7 @@ where
peer: PeerId,
_: &Multiaddr,
_: Endpoint,
_: PortUse,
) -> Result<THandler<Self>, ConnectionDenied> {
self.state.enforce(&peer)?;

Expand Down
3 changes: 2 additions & 1 deletion misc/connection-limits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

Check failure on line 18 in misc/connection-limits/src/lib.rs

View workflow job for this annotation

GitHub Actions / rustfmt

Diff in /home/runner/work/rust-libp2p/rust-libp2p/misc/connection-limits/src/lib.rs
// DEALINGS IN THE SOFTWARE.

use libp2p_core::{ConnectedPoint, Endpoint, Multiaddr};
use libp2p_core::{ConnectedPoint, Endpoint, Multiaddr, transport::PortUse};
use libp2p_identity::PeerId;
use libp2p_swarm::{
behaviour::{ConnectionEstablished, DialFailure, ListenFailure},
Expand Down Expand Up @@ -278,6 +278,7 @@ impl NetworkBehaviour for Behaviour {
peer: PeerId,
_: &Multiaddr,
_: Endpoint,
_: PortUse,
) -> Result<THandler<Self>, ConnectionDenied> {
self.pending_outbound_connections.remove(&connection_id);

Expand Down

0 comments on commit 37cd309

Please sign in to comment.