From dcdd3838ef9a8b4064ec9f9d4519b3e66e26a029 Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Fri, 17 Jan 2014 10:58:50 -0800 Subject: [PATCH] P2P: Reduce peer expiration age to 60 sec and allow customization The new default value (from 300 to 60 seconds) makes the internal P2P peer list somewhat faster to react to peers becoming unreachable while still maintaining entries for some time to avoid them disappearing during user interaction (e.g., selecting a peer for a connection or entering a PIN). Signed-off-by: Dmitry Shmidt --- src/p2p/p2p.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 0f722fb33..8aabfc01b 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -41,7 +41,9 @@ static void p2p_scan_timeout(void *eloop_ctx, void *timeout_ctx); * P2P_PEER_EXPIRATION_AGE - Number of seconds after which inactive peer * entries will be removed */ -#define P2P_PEER_EXPIRATION_AGE 300 +#ifndef P2P_PEER_EXPIRATION_AGE +#define P2P_PEER_EXPIRATION_AGE 60 +#endif /* P2P_PEER_EXPIRATION_AGE */ #define P2P_PEER_EXPIRATION_INTERVAL (P2P_PEER_EXPIRATION_AGE / 2)