diff options
Diffstat (limited to 'src/swarm/sync.rs')
| -rw-r--r-- | src/swarm/sync.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs index 1335361..dc2e665 100644 --- a/src/swarm/sync.rs +++ b/src/swarm/sync.rs @@ -63,7 +63,8 @@ async fn deliver_sync_to_peer(state: &AppState, peer: &str, retry_delivery: bool }; if !retry_delivery { - if let Some(wait) = peer_state.sync.opening_wait(Instant::now()) { + let now = Instant::now(); + if let Some(wait) = peer_state.sync.opening_wait(now) { trace!( wait_ms = wait.as_millis(), "Leaving the opening sync message to the peer" @@ -76,6 +77,14 @@ async fn deliver_sync_to_peer(state: &AppState, peer: &str, retry_delivery: bool }); return Ok(()); } + if peer_state.sync.opening_overdue(now) { + debug!( + cause = ?peer_state.sync.cause, + reply_owed = peer_state.reply_owed, + likely = peer_state.sync.cause.missing_opening_hint(), + "The peer didn't open the sync within the grace period; opening ourselves" + ); + } } swarm_id.clone() |
