node: Fix keep-alive delta

By having the keep-alive delta be the same as the ping timeout,
we essentially disconnected peers right after we sent them our
first ping.

This fixes that issue by setting the ping timeout to double the
keep-alive delta.
This commit is contained in:
Alexis Sellier 2023-04-21 14:19:50 +02:00
parent 4bac839e0a
commit bf8653b6c2
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ pub const SYNC_INTERVAL: LocalDuration = LocalDuration::from_secs(60);
/// How often to run the "prune" task.
pub const PRUNE_INTERVAL: LocalDuration = LocalDuration::from_mins(30);
/// Duration to wait on an unresponsive peer before dropping its connection.
pub const STALE_CONNECTION_TIMEOUT: LocalDuration = LocalDuration::from_mins(1);
pub const STALE_CONNECTION_TIMEOUT: LocalDuration = LocalDuration::from_mins(2);
/// How much time should pass after a peer was last active for a *ping* to be sent.
pub const KEEP_ALIVE_DELTA: LocalDuration = LocalDuration::from_mins(1);
/// Maximum time difference between the local time, and an announcement timestamp.