alanmcgovern / monotorrent

The official repository for MonoTorrent, a bittorrent library for .NET
https://github.com/alanmcgovern/monotorrent
MIT License
1.16k stars 397 forks source link

Check and ban peer when accepting incoming connection #691

Closed kaedei closed 2 months ago

kaedei commented 2 months ago

Description

The current implementation only checks if a peer should be banned during TryConnect. This PR adds a check using ShouldBanPeer() within the IncomingConnectionAcceptedAsync() method to ensure that peers are also evaluated for banning when an incoming connection is accepted.

Changes

Motivation

Enhancing the robustness of the peer banning mechanism by ensuring that peers are evaluated for banning not only during connection attempts but also when incoming connections are accepted.

kaedei commented 2 months ago

Sorry, selected wrong branch. I will create a new PR for this.