Skip to content

Commit

Permalink
don't update found router again in RequestComplete
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Oct 31, 2024
1 parent 0086f8e commit b2a10ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libi2pd/Transports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Peer>(r, ts);

peer = std::make_shared<Peer>(r, i2p::util::GetSecondsSinceEpoch ());
{
std::unique_lock<std::mutex> l(m_PeersMutex);
peer = m_Peers.emplace (ident, peer).first->second;
}
Expand Down Expand Up @@ -722,7 +722,7 @@ namespace transport
void Transports::HandleRequestComplete (std::shared_ptr<const i2p::data::RouterInfo> 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)
{
Expand Down

0 comments on commit b2a10ac

Please sign in to comment.