mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 03:37:49 +02:00
don't drop profile of real router too early
This commit is contained in:
parent
ae439b5385
commit
86173400d5
2 changed files with 5 additions and 9 deletions
|
@ -224,15 +224,11 @@ namespace data
|
|||
return (bool)m_LastUnreachableTime;
|
||||
}
|
||||
|
||||
bool RouterProfile::IsUseful() const {
|
||||
return
|
||||
m_NumTunnelsAgreed >= PEER_PROFILE_USEFUL_THRESHOLD ||
|
||||
m_NumTunnelsDeclined >= PEER_PROFILE_USEFUL_THRESHOLD ||
|
||||
m_NumTunnelsNonReplied >= PEER_PROFILE_USEFUL_THRESHOLD ||
|
||||
m_HasConnected;
|
||||
bool RouterProfile::IsUseful() const
|
||||
{
|
||||
return IsReal () || m_NumTunnelsNonReplied >= PEER_PROFILE_USEFUL_THRESHOLD;
|
||||
}
|
||||
|
||||
|
||||
std::shared_ptr<RouterProfile> GetRouterProfile (const IdentHash& identHash)
|
||||
{
|
||||
{
|
||||
|
@ -286,7 +282,7 @@ namespace data
|
|||
}
|
||||
auto ts = GetTime ();
|
||||
for (auto& it: tmp)
|
||||
if (it.second->IsUseful() && it.second->IsUpdated () && (ts - it.second->GetLastUpdateTime ()).total_seconds () < PEER_PROFILE_EXPIRATION_TIMEOUT*3600)
|
||||
if (it.second->IsUseful() && (it.second->IsUpdated () || (ts - it.second->GetLastUpdateTime ()).total_seconds () < PEER_PROFILE_EXPIRATION_TIMEOUT*3600))
|
||||
it.second->Save (it.first);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue