mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-10 11:28:27 +01:00
don't expire connected routers
This commit is contained in:
parent
abf687ff09
commit
8544283110
1 changed files with 19 additions and 14 deletions
|
@ -664,6 +664,8 @@ namespace data
|
||||||
if (it.second->IsUnreachable () && (total - deletedCount < NETDB_MIN_ROUTERS || isLowRate ||
|
if (it.second->IsUnreachable () && (total - deletedCount < NETDB_MIN_ROUTERS || isLowRate ||
|
||||||
(it.second->IsFloodfill () && totalFloodfills - deletedFloodfillsCount < NETDB_MIN_FLOODFILLS)))
|
(it.second->IsFloodfill () && totalFloodfills - deletedFloodfillsCount < NETDB_MIN_FLOODFILLS)))
|
||||||
it.second->SetUnreachable (false);
|
it.second->SetUnreachable (false);
|
||||||
|
if (!it.second->IsUnreachable ())
|
||||||
|
{
|
||||||
// find & mark expired routers
|
// find & mark expired routers
|
||||||
if (!it.second->IsReachable () && (it.second->GetCompatibleTransports (true) & RouterInfo::eSSU2V4))
|
if (!it.second->IsReachable () && (it.second->GetCompatibleTransports (true) & RouterInfo::eSSU2V4))
|
||||||
// non-reachable router, but reachable by ipv4 SSU2 means introducers
|
// non-reachable router, but reachable by ipv4 SSU2 means introducers
|
||||||
|
@ -679,6 +681,9 @@ namespace data
|
||||||
LogPrint (eLogWarning, "NetDb: RouterInfo is from future for ", (it.second->GetTimestamp () - ts)/1000LL, " seconds");
|
LogPrint (eLogWarning, "NetDb: RouterInfo is from future for ", (it.second->GetTimestamp () - ts)/1000LL, " seconds");
|
||||||
it.second->SetUnreachable (true);
|
it.second->SetUnreachable (true);
|
||||||
}
|
}
|
||||||
|
if (it.second->IsUnreachable () && i2p::transport::transports.IsConnected (it.second->GetIdentHash ()))
|
||||||
|
it.second->SetUnreachable (false); // don't expire connected router
|
||||||
|
}
|
||||||
|
|
||||||
if (it.second->IsUnreachable ())
|
if (it.second->IsUnreachable ())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue