Implemented purging old disconnected peers.

This commit is contained in:
Revertron
2021-03-21 01:31:33 +01:00
parent fdc5b8f233
commit 0b5f5d0793
11 changed files with 48 additions and 14 deletions
+17
View File
@@ -0,0 +1,17 @@
pub const CHAIN_VERSION: u32 = 1;
pub const ZONE_DIFFICULTY: u32 = 28;
pub const BLOCK_DIFFICULTY: u32 = 24;
pub const LOCKER_DIFFICULTY: u32 = 18;
pub const KEYSTORE_DIFFICULTY: usize = 25;
pub const LOCKER_BLOCK_START: u64 = 12;
pub const LOCKER_BLOCK_LOCKERS: u64 = 6;
pub const LOCKER_BLOCK_SIGNS: u64 = 4;
pub const LOCKER_BLOCK_TIME: i64 = 300;
pub const LOCKER_BLOCK_INTERVAL: u64 = 50;
pub const FULL_BLOCKS_INTERVAL: i64 = 86400; // One day in seconds
pub const ZONE_MAX_LENGTH: usize = 10;
pub const MAX_RECONNECTS: u32 = 5;
+4 -1
View File
@@ -3,6 +3,9 @@ use rand::Rng;
#[cfg(not(target_os = "macos"))]
use thread_priority::*;
pub mod constants;
pub use constants::*;
/// Convert bytes array to HEX format
pub fn to_hex(buf: &[u8]) -> String {
let mut result = String::new();
@@ -111,4 +114,4 @@ mod test {
assert!(!check_domain(".ab.c", true));
assert!(!check_domain("ab.c-", true));
}
}
}