[style] clean code

Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
R4SAS 2023-02-11 09:41:51 +03:00
parent 3c65012a63
commit 86fc12e395
No known key found for this signature in database
GPG key ID: 66F6C87B98EBCFE2
18 changed files with 175 additions and 175 deletions

View file

@ -136,15 +136,15 @@ namespace data
{
UpdateTime ();
if (ret > 0)
{
{
m_NumTunnelsDeclined++;
m_LastDeclineTime = i2p::util::GetSecondsSinceEpoch ();
}
}
else
{
{
m_NumTunnelsAgreed++;
m_LastDeclineTime = 0;
}
}
}
void RouterProfile::TunnelNonReplied ()
@ -158,8 +158,8 @@ namespace data
void RouterProfile::Unreachable ()
{
m_LastUnreachableTime = i2p::util::GetSecondsSinceEpoch ();
}
}
bool RouterProfile::IsLowPartcipationRate () const
{
return 4*m_NumTunnelsAgreed < m_NumTunnelsDeclined; // < 20% rate
@ -179,8 +179,8 @@ namespace data
ts + PEER_PROFILE_DECLINED_RECENTLY_INTERVAL < m_LastDeclineTime)
m_LastDeclineTime = 0;
return (bool)m_LastDeclineTime;
}
}
bool RouterProfile::IsBad ()
{
if (IsDeclinedRecently () || IsUnreachable ()) return true;
@ -205,8 +205,8 @@ namespace data
ts + PEER_PROFILE_UNREACHABLE_INTERVAL < m_LastUnreachableTime)
m_LastUnreachableTime = 0;
return (bool)m_LastUnreachableTime;
}
}
std::shared_ptr<RouterProfile> GetRouterProfile (const IdentHash& identHash)
{
auto profile = std::make_shared<RouterProfile> ();