diff --git a/libi2pd/Transports.cpp b/libi2pd/Transports.cpp index 178188f2..73c58ea2 100644 --- a/libi2pd/Transports.cpp +++ b/libi2pd/Transports.cpp @@ -491,9 +491,9 @@ namespace transport { auto r = netdb.FindRouter (ident); if (r && (r->IsUnreachable () || !r->IsReachableFrom (i2p::context.GetRouterInfo ()))) return; // router found but non-reachable - { - auto ts = i2p::util::GetSecondsSinceEpoch (); - peer = std::make_shared(r, ts); + + peer = std::make_shared(r, i2p::util::GetSecondsSinceEpoch ()); + { std::unique_lock l(m_PeersMutex); peer = m_Peers.emplace (ident, peer).first->second; } @@ -722,7 +722,7 @@ namespace transport void Transports::HandleRequestComplete (std::shared_ptr r, i2p::data::IdentHash ident) { auto it = m_Peers.find (ident); - if (it != m_Peers.end ()) + if (it != m_Peers.end () && !it->second->router) { if (r) {