Merge pull request #1051 from JosephGoulden/fix_ping_disconnect
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Fri, 20 Aug 2021 18:06:58 +0000 (18:06 +0000)
committerGitHub <noreply@github.com>
Fri, 20 Aug 2021 18:06:58 +0000 (18:06 +0000)
fix: peer is disconnected for not responding to ping

lightning-background-processor/src/lib.rs

index 4fdf2eeff03e298cc9dda25fb28739101f361fcf..a0751a9d0f4b3055fdb605a95c46033f55ce0e2b 100644 (file)
@@ -50,7 +50,13 @@ const FRESHNESS_TIMER: u64 = 60;
 #[cfg(test)]
 const FRESHNESS_TIMER: u64 = 1;
 
+#[cfg(not(debug_assertions))]
 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.
 ///