From 6febc8176fd2e18e1e8503d3eeaa1a9b5ca74797 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 25 Oct 2026 22:45:35 +0100 Subject: MYCELIUM_DELIVERY_LIMIT -> Timing::delivery_limit --- src/state.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/state.rs') diff --git a/src/state.rs b/src/state.rs index e6054ad..5ec1c5a 100644 --- a/src/state.rs +++ b/src/state.rs @@ -224,6 +224,8 @@ const SYNC_REPLY_TIMEOUT: Duration = Duration::from_secs(10); /// Upper bound, as a multiple of the first wait: 5 minutes (Mycelium gives up on a /// message after five minutes). const SYNC_REPLY_TIMEOUT_MAX_FACTOR: u32 = 30; +/// How long Mycelium tries to deliver a message before dropping it. +const MYCELIUM_DELIVERY_LIMIT: Duration = Duration::from_secs(300); impl SyncSession { /// `reply_backoff`: waits for sync answers (`Timing::sync_reply_backoff`). @@ -533,6 +535,9 @@ pub(crate) struct Timing { /// First wait for an answer to a sync message before sending again; doubles while /// answers stay out (`SyncSession::reply_backoff`). pub(crate) sync_reply_timeout: Duration, + /// How long the transport tries to deliver a message before dropping it (Mycelium: + /// five minutes): a peer silent for longer has nothing on the way to us any more. + pub(crate) delivery_limit: Duration, } impl Timing { @@ -567,6 +572,7 @@ impl Timing { // Only the source gets these, and only while catching up. catch_up_probe: (keepalive / 30).clamp(Duration::from_secs(1), Duration::from_secs(5)), sync_reply_timeout, + delivery_limit: MYCELIUM_DELIVERY_LIMIT, } } -- cgit v1.3.1