Fixed ban mechanism, updated dependencies.

This commit is contained in:
Revertron
2022-06-09 16:57:48 +02:00
parent 47fbe44396
commit f9fb935264
4 changed files with 15 additions and 14 deletions
+1 -1
View File
@@ -49,4 +49,4 @@ pub const MIN_CONNECTED_NODES_START_SYNC: usize = 4;
pub const MAX_READ_BLOCK_TIME: u128 = 100;
pub const MAX_RECONNECTS: u32 = 5;
pub const MAX_IDLE_SECONDS: u64 = 180;
pub const MAX_NODES: usize = 25;
pub const MAX_NODES: usize = 20;
+2 -1
View File
@@ -268,9 +268,10 @@ impl Peers {
}
// Just purging ignored/banned IPs every 10 minutes
// TODO make it individual
// TODO make it individual for every IP
if self.ignore_timer.elapsed().as_secs() >= 600 {
self.ignored.clear();
self.ignore_timer = Instant::now();
}
// If someone has more blocks we sync