Implements a timeout for peer banning (#665)

* Adds peer ban timeout of 30 seconds

* Remove delay queue from discovery
This commit is contained in:
Age Manning
2019-12-06 14:13:43 +11:00
committed by Paul Hauner
parent 5e8f958977
commit 5a765396b7
14 changed files with 92 additions and 50 deletions

View File

@@ -241,6 +241,11 @@ impl<TSubstream: AsyncRead + AsyncWrite> Behaviour<TSubstream> {
self.discovery.peer_banned(peer_id);
}
/// Notify discovery that the peer has been unbanned.
pub fn peer_unbanned(&mut self, peer_id: &PeerId) {
self.discovery.peer_unbanned(peer_id);
}
/// Informs the discovery behaviour if a new IP/Port is set at the application layer
pub fn update_local_enr_socket(&mut self, socket: std::net::SocketAddr, is_tcp: bool) {
self.discovery.update_local_enr(socket, is_tcp);