mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
exclude previously non-reachable transports
This commit is contained in:
parent
527ee3b3c5
commit
b77ae08388
4 changed files with 28 additions and 5 deletions
|
@ -409,19 +409,29 @@ namespace data
|
|||
|
||||
void NetDb::SetUnreachable (const IdentHash& ident, bool unreachable)
|
||||
{
|
||||
auto it = m_RouterInfos.find (ident);
|
||||
if (it != m_RouterInfos.end ())
|
||||
auto r = FindRouter (ident);
|
||||
if (r)
|
||||
{
|
||||
it->second->SetUnreachable (unreachable);
|
||||
r->SetUnreachable (unreachable);
|
||||
if (unreachable)
|
||||
{
|
||||
auto profile = it->second->GetProfile ();
|
||||
auto profile = r->GetProfile ();
|
||||
if (profile)
|
||||
profile->Unreachable ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NetDb::ExcludeReachableTransports (const IdentHash& ident, RouterInfo::CompatibleTransports transports)
|
||||
{
|
||||
auto r = FindRouter (ident);
|
||||
if (r)
|
||||
{
|
||||
std::unique_lock<std::mutex> l(m_RouterInfosMutex);
|
||||
r->ExcludeReachableTransports (transports);
|
||||
}
|
||||
}
|
||||
|
||||
void NetDb::Reseed ()
|
||||
{
|
||||
if (!m_Reseeder)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue