MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / AddConnectedRecently

Method AddConnectedRecently

libi2pd/SSU2.cpp:237–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235 }
236
237 void SSU2Server::AddConnectedRecently (const boost::asio::ip::udp::endpoint& ep, uint64_t ts)
238 {
239 if (!ep.port () || ep.address ().is_unspecified () ||
240 i2p::util::GetSecondsSinceEpoch () > ts + SSU2_MAX_HOLE_PUNCH_EXPIRATION) return;
241 std::lock_guard<std::mutex> l(m_ConnectedRecentlyMutex);
242 auto [it, added] = m_ConnectedRecently.try_emplace (ep, ts);
243 if (!added && ts > it->second)
244 it->second = ts; // renew timestamp of existing endpoint
245 }
246
247 void SSU2Server::AdjustTimeOffset (int64_t offset, std::shared_ptr<const i2p::data::IdentityEx> from)
248 {

Callers 2

HandlePeerTestMethod · 0.80
TerminateMethod · 0.80

Calls 1

GetSecondsSinceEpochFunction · 0.85

Tested by

no test coverage detected