Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions client/peerset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ impl Peerset {
set_id: SetId(set_index),
peer_id: peer.into_peer_id(),
});

self.alloc_slots(SetId(set_index));
}
}
}
Expand Down Expand Up @@ -520,6 +522,14 @@ impl Peerset {
peersstate::Peer::Connected(_) => continue,
};

// Don't connect to nodes with an abysmal reputation, even if they're reserved.
// This is a rather opinionated behaviour, and it wouldn't be fundamentally wrong to
// remove that check. If necessary, the peerset should be refactored to give more
// control over what happens in that situation.
if entry.reputation() < BANNED_THRESHOLD {
break;
}

match entry.try_outgoing() {
Ok(conn) => self.message_queue.push_back(Message::Connect {
set_id,
Expand Down