| 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 | { |
no test coverage detected