pub fn ban(&self, now: &Instant, hashes: impl IntoIterator<Item=Hash>) {
		let mut banned = self.banned_until.write();

		for hash in hashes {
			banned.insert(hash, *now + self.ban_time);
		}

		if banned.len() > 2 * EXPECTED_SIZE {
			while banned.len() > EXPECTED_SIZE {
				if let Some(key) = banned.keys().next().cloned() {
					banned.remove(&key);
				}
			}
		}
	}
/// Bans given set of hashes.
Bans given set of hashes.
Bans given set of hashes .
pub fn ban(&self, now: &Instant, hashes: impl IntoIterator<Item=Hash>) {
		let mut banned = self.banned_until.write();
		for hash in hashes {
			banned.insert(hash, *now + self.ban_time);
		}
		if banned.len() > 2 * EXPECTED_SIZE {
			while banned.len() > EXPECTED_SIZE {
				if let Some(key) = banned.keys().next().cloned() {
					banned.remove(&key);
				}
			}
		}
	}
pub fn ban ( & self , now : & Instant , hashes : impl IntoIterator < Item = Hash > ) { let mut banned = self . banned_until . write ( ) ; for hash in hashes { banned . insert ( hash , * now + self . ban_time ) ; } if banned . len ( ) > 2 * EXPECTED_SIZE { while banned . len ( ) > EXPECTED_SIZE { if let Some ( key ) = banned . keys ( ) . next ( ) . cloned ( ) { banned . remove ( & key ) ; } } } }
Bans given set of hashes.
Bans given set of hashes .
&self
now
&Instant
hashes
impl IntoIterator<Item=Hash>
&self
now
&Instant
hashes
impl IntoIterator<Item=Hash>