peer: block only non-blocked to not increase times for several requests

This commit is contained in:
ardocrat
2026-03-30 23:09:09 +03:00
parent 4511fd89a2
commit 464babc7ef
+3
View File
@@ -204,6 +204,9 @@ impl Peer {
/// Set this peer status to blocked.
pub fn set_blocked(&self) {
if self.is_blocked() {
return;
}
let times = {
match *self.state.read() {
State::Blocked(_, times) => times + 1,