Skip to content

Commit

Permalink
ban peer for 10s after disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
melekes committed Feb 20, 2023
1 parent f1dc623 commit 3859201
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/network/src/protocol/notifications/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,11 @@ impl Notifications {
}

/// Disconnects the given peer if we are connected to it.
///
/// Note the peer will be banned for 10s after this.
pub fn disconnect_peer(&mut self, peer_id: &PeerId, set_id: sc_peerset::SetId) {
trace!(target: "sub-libp2p", "External API => Disconnect({}, {:?})", peer_id, set_id);
self.disconnect_peer_inner(peer_id, set_id, None);
self.disconnect_peer_inner(peer_id, set_id, Some(Duration::from_secs(10)));
}

/// Inner implementation of `disconnect_peer`.
Expand Down

0 comments on commit 3859201

Please sign in to comment.