Creates a new [`RejectionCache`] with the given capacity and TTL.
(max_capacity: u64, ttl: Duration)
| 40 | impl RejectionCache { |
| 41 | /// Creates a new [`RejectionCache`] with the given capacity and TTL. |
| 42 | pub fn new(max_capacity: u64, ttl: Duration) -> Self { |
| 43 | Self(Cache::builder().max_capacity(max_capacity).time_to_live(ttl).build()) |
| 44 | } |
| 45 | |
| 46 | /// Returns `true` if `hash` is cached as permanently rejected. |
| 47 | pub fn is_rejected(&self, hash: &TxHash) -> bool { |