Merge pull request #1051 from JosephGoulden/fix_ping_disconnect

fix: peer is disconnected for not responding to ping
This commit is contained in:
Matt Corallo 2021-08-20 18:06:58 +00:00 committed by GitHub
commit 2ced708b71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,7 +50,13 @@ const FRESHNESS_TIMER: u64 = 60;
#[cfg(test)] #[cfg(test)]
const FRESHNESS_TIMER: u64 = 1; const FRESHNESS_TIMER: u64 = 1;
#[cfg(not(debug_assertions))]
const PING_TIMER: u64 = 5; const PING_TIMER: u64 = 5;
/// Signature operations take a lot longer without compiler optimisations.
/// Increasing the ping timer allows for this but slower devices will be disconnected if the
/// timeout is reached.
#[cfg(debug_assertions)]
const PING_TIMER: u64 = 30;
/// Trait which handles persisting a [`ChannelManager`] to disk. /// Trait which handles persisting a [`ChannelManager`] to disk.
/// ///