diff --git a/libi2pd/NetDb.cpp b/libi2pd/NetDb.cpp index 71d8779b..da4fcd7b 100644 --- a/libi2pd/NetDb.cpp +++ b/libi2pd/NetDb.cpp @@ -1451,9 +1451,11 @@ namespace data IdentHash destKey = CreateRoutingKey (destination); minMetric.SetMax (); // must be called from NetDb thread only + bool checkIsReal = i2p::tunnel::tunnels.GetPreciseTunnelCreationSuccessRate () < NETDB_TUNNEL_CREATION_RATE_THRESHOLD; // too low rate + std::lock_guard l(m_RouterInfosMutex); for (const auto& it: m_RouterInfos) { - if (!it.second->IsDeclaredFloodfill () && it.second->GetProfile ()->IsReal ()) + if (!it.second->IsDeclaredFloodfill () && (!checkIsReal || (it.second->HasProfile () && it.second->GetProfile ()->IsReal ()))) { XORMetric m = destKey ^ it.first; if (m < minMetric && !excluded.count (it.first)) diff --git a/libi2pd/RouterInfo.h b/libi2pd/RouterInfo.h index 40534320..ad388611 100644 --- a/libi2pd/RouterInfo.h +++ b/libi2pd/RouterInfo.h @@ -280,6 +280,7 @@ namespace data std::shared_ptr GetProfile () const; void DropProfile () { m_Profile = nullptr; }; + bool HasProfile () const { return (bool)m_Profile; }; bool Update (const uint8_t * buf, size_t len); void DeleteBuffer () { m_Buffer = nullptr; };