last_connection expiration

This commit is contained in:
John Smith
2022-04-17 19:10:10 -04:00
parent 5527740f6a
commit 9cee8c292f
6 changed files with 176 additions and 21 deletions

View File

@@ -21,7 +21,7 @@ const UNRELIABLE_PING_INTERVAL_SECS: u32 = 5;
// Keepalive pings are done occasionally to ensure holepunched public dialinfo
// remains valid, as well as to make sure we remain in any relay node's routing table
const KEEPALIVE_PING_INTERVAL_SECS: u32 = 30;
const KEEPALIVE_PING_INTERVAL_SECS: u32 = 20;
// Do not change order here, it will mess up other sorts
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
@@ -131,8 +131,8 @@ impl BucketEntry {
self.last_connection = Some((last_connection, timestamp));
}
pub fn last_connection(&self) -> Option<ConnectionDescriptor> {
self.last_connection.as_ref().map(|x| x.0)
pub fn last_connection(&self) -> Option<(ConnectionDescriptor, u64)> {
self.last_connection
}
pub fn set_min_max_version(&mut self, min_max_version: (u8, u8)) {