1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-13 07:33:02 +00:00

feat: disconnect blocklisted peers on blocklist update (#7167)

* Fix: disconnect blocklisted peer on blocklist update.

Mark peer to be disconnected upon blocklist update.
Tested on my torrent, seems to be working.

Fix #732 .

* Add debug message when blocking peers

Add debug message each time a peer gets blocked during blocklist update.

* Change log api

Co-authored-by: Yat Ho <lagoho7@gmail.com>

---------

Co-authored-by: Yat Ho <lagoho7@gmail.com>
This commit is contained in:
cdowen 2025-03-10 07:33:09 +08:00 committed by GitHub
parent 42ccb54c98
commit 4e7fc81975
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1173,6 +1173,11 @@ private:
for (auto* const peer : tor->swarm->peers)
{
peer->peer_info->set_blocklisted_dirty();
if (peer->peer_info->is_blocklisted(blocklists_))
{
peer->disconnect_soon();
tr_logAddDebugTor(tor, fmt::format("Peer {} blocked in blocklists update", peer->display_name()));
}
}
}
}