From 220b8837da1e3d449bf9ddcc674b71d6d10c7993 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Thu, 3 Jun 2021 10:32:36 -0400 Subject: [PATCH] delay setting sentIntro by the advertised latency of the remote intro instead of static value --- llarp/service/outbound_context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llarp/service/outbound_context.cpp b/llarp/service/outbound_context.cpp index 1a9507b36..040ac6886 100644 --- a/llarp/service/outbound_context.cpp +++ b/llarp/service/outbound_context.cpp @@ -239,7 +239,8 @@ namespace llarp ex->hook = [self = shared_from_this(), path](auto frame) { if (not self->Send(std::move(frame), path)) return; - self->m_Endpoint->Loop()->call_later(100ms, [self]() { self->sentIntro = true; }); + self->m_Endpoint->Loop()->call_later( + self->remoteIntro.latency, [self]() { self->sentIntro = true; }); }; ex->msg.PutBuffer(payload);