Struct snarkos_node_bft::helpers::cache::Cache
source · pub struct Cache<N: Network> { /* private fields */ }Implementations§
source§impl<N: Network> Cache<N>
impl<N: Network> Cache<N>
sourcepub fn insert_inbound_connection(
&self,
peer_ip: IpAddr,
interval_in_secs: i64
) -> usize
pub fn insert_inbound_connection( &self, peer_ip: IpAddr, interval_in_secs: i64 ) -> usize
Inserts a new timestamp for the given peer connection, returning the number of recent connection requests.
sourcepub fn insert_inbound_event(
&self,
peer_ip: SocketAddr,
interval_in_secs: i64
) -> usize
pub fn insert_inbound_event( &self, peer_ip: SocketAddr, interval_in_secs: i64 ) -> usize
Inserts a new timestamp for the given peer, returning the number of recent events.
sourcepub fn insert_inbound_certificate(
&self,
key: Field<N>,
interval_in_secs: i64
) -> usize
pub fn insert_inbound_certificate( &self, key: Field<N>, interval_in_secs: i64 ) -> usize
Inserts a certificate ID into the cache, returning the number of recent events.
sourcepub fn insert_inbound_transmission(
&self,
key: TransmissionID<N>,
interval_in_secs: i64
) -> usize
pub fn insert_inbound_transmission( &self, key: TransmissionID<N>, interval_in_secs: i64 ) -> usize
Inserts a transmission ID into the cache, returning the number of recent events.
source§impl<N: Network> Cache<N>
impl<N: Network> Cache<N>
sourcepub fn insert_outbound_event(
&self,
peer_ip: SocketAddr,
interval_in_secs: i64
) -> usize
pub fn insert_outbound_event( &self, peer_ip: SocketAddr, interval_in_secs: i64 ) -> usize
Inserts a new timestamp for the given peer, returning the number of recent events.
sourcepub fn insert_outbound_certificate(
&self,
peer_ip: SocketAddr,
interval_in_secs: i64
) -> usize
pub fn insert_outbound_certificate( &self, peer_ip: SocketAddr, interval_in_secs: i64 ) -> usize
Inserts a new timestamp for the given peer, returning the number of recent events.
sourcepub fn insert_outbound_transmission(
&self,
peer_ip: SocketAddr,
interval_in_secs: i64
) -> usize
pub fn insert_outbound_transmission( &self, peer_ip: SocketAddr, interval_in_secs: i64 ) -> usize
Inserts a new timestamp for the given peer, returning the number of recent events.
source§impl<N: Network> Cache<N>
impl<N: Network> Cache<N>
sourcepub fn contains_outbound_validators_request(&self, peer_ip: SocketAddr) -> bool
pub fn contains_outbound_validators_request(&self, peer_ip: SocketAddr) -> bool
Returns true if the cache contains a validators request from the given IP.
sourcepub fn increment_outbound_validators_requests(&self, peer_ip: SocketAddr) -> u16
pub fn increment_outbound_validators_requests(&self, peer_ip: SocketAddr) -> u16
Increment the IP’s number of validators requests, returning the updated number of validators requests.
sourcepub fn decrement_outbound_validators_requests(&self, peer_ip: SocketAddr) -> u16
pub fn decrement_outbound_validators_requests(&self, peer_ip: SocketAddr) -> u16
Decrement the IP’s number of validators requests, returning the updated number of validators requests.