Skip to content

Commit 2d3a210

Browse files
committed
Increase our PING_TIMER to ten seconds, from five.
Because many lightning nodes can take quite some time to respond to pings, the five second ping timer can sometimes cause spurious disconnects even though a peer is online. However, in part as a response to mobile users where a connection may be lost as result of only a short time with the app in a "paused" state, we had a rather aggressive ping time to ensure we would disconnect quickly. However, since we now just used a fixed time for the "went to sleep" detection, we can somewhat increase the ping timer. We still want to be fairly aggressive to avoid sending HTLCs to a peer that is offline, but the tradeoff between spurious disconnections and stuck payments is likely doesn't need to be quite as aggressive.
1 parent 8f5023a commit 2d3a210

File tree

1 file changed

+1
-1
lines changed
  • lightning-background-processor/src

1 file changed

+1
-1
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const FRESHNESS_TIMER: u64 = 60;
6161
const FRESHNESS_TIMER: u64 = 1;
6262

6363
#[cfg(all(not(test), not(debug_assertions)))]
64-
const PING_TIMER: u64 = 5;
64+
const PING_TIMER: u64 = 10;
6565
/// Signature operations take a lot longer without compiler optimisations.
6666
/// Increasing the ping timer allows for this but slower devices will be disconnected if the
6767
/// timeout is reached.

0 commit comments

Comments
 (0)