mirror of
https://github.com/transmission/transmission
synced 2025-03-12 23:23:54 +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:
parent
42ccb54c98
commit
4e7fc81975
1 changed files with 5 additions and 0 deletions
|
@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue