diff options
Diffstat (limited to 'src/swarm/source.rs')
| -rw-r--r-- | src/swarm/source.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/swarm/source.rs b/src/swarm/source.rs index a8866a6..d5b572a 100644 --- a/src/swarm/source.rs +++ b/src/swarm/source.rs @@ -20,7 +20,7 @@ //! big answer lost on the way, a stuck sync state) would keep us catching up forever. //! So it is also given up after three of our sync messages in a row went unanswered, //! once nothing from it can still be on the way: no sync message from it for -//! `MYCELIUM_DELIVERY_LIMIT`, after which Mycelium has delivered or dropped anything it +//! `Timing::delivery_limit`, after which Mycelium has delivered or dropped anything it //! sent before. Meanwhile, every minute without a sync message from it is logged as a //! warning. @@ -46,10 +46,6 @@ const REFUSALS: u32 = 2; /// Unanswered sync messages in a row before the source may be given up. const REPLY_TIMEOUTS: u32 = 3; -/// How long Mycelium tries to deliver a message before dropping it: a source silent -/// (in sync) for longer has nothing on the way to us any more. -const MYCELIUM_DELIVERY_LIMIT: Duration = Duration::from_secs(300); - /// How often a stalled catch-up is logged. const STALL_WARNING: Duration = Duration::from_secs(60); @@ -170,7 +166,8 @@ pub(crate) fn reply_timed_out(state: &AppState, peer: &str) { }; current.reply_timeouts += 1; let silent = current.last_sync.elapsed(); - let give_up = current.reply_timeouts >= REPLY_TIMEOUTS && silent >= MYCELIUM_DELIVERY_LIMIT; + let give_up = + current.reply_timeouts >= REPLY_TIMEOUTS && silent >= state.timing.delivery_limit; let timeouts = current.reply_timeouts; if give_up { *source = None; |
