Optimized p2p connections.

Added a limit for 10 active connections to save bandwidth and CPU.
This commit is contained in:
Revertron
2021-04-23 13:20:26 +02:00
parent 0d944ca1dc
commit 520f485899
7 changed files with 26 additions and 22 deletions
+7
View File
@@ -1,3 +1,5 @@
use std::time::Duration;
pub const DB_VERSION: u32 = 0;
pub const CHAIN_VERSION: u32 = 0;
@@ -38,3 +40,8 @@ pub const ALFIS_DEBUG: &str = "ALFIS_DEBUG";
pub const LISTEN_PORT: u16 = 4244;
pub const UI_REFRESH_DELAY_MS: u128 = 250;
pub const LOG_REFRESH_DELAY_SEC: u64 = 60;
pub const POLL_TIMEOUT: Option<Duration> = Some(Duration::from_millis(250));
pub const MAX_PACKET_SIZE: usize = 1 * 1024 * 1024; // 1 Mb
pub const MAX_READ_BLOCK_TIME: u128 = 500;
pub const MAX_NODES: usize = 10;