Browse Source

don't adjust clock if time offsets are too different

pull/2003/head
orignal 11 months ago
parent
commit
b855c71891
  1. 5
      libi2pd/SSU2.cpp

5
libi2pd/SSU2.cpp

@ -215,10 +215,15 @@ namespace transport @@ -215,10 +215,15 @@ namespace transport
if (offset)
{
if (m_PendingTimeOffset) // one more
{
if (std::abs (m_PendingTimeOffset - offset) < SSU2_CLOCK_SKEW)
{
offset = (m_PendingTimeOffset + offset)/2; // average
LogPrint (eLogWarning, "SSU2: Clock adjusted by ", offset, " seconds");
i2p::util::AdjustTimeOffset (offset);
}
else
LogPrint (eLogWarning, "SSU2: Time offsets are too different. Clock not adjusted");
m_PendingTimeOffset = 0;
}
else

Loading…
Cancel
Save