mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-19 01:09:58 +00:00
don't request banned router
This commit is contained in:
parent
f1058410fb
commit
20a5e19ea1
@ -492,9 +492,9 @@ namespace transport
|
||||
if (sz < CHECK_PROFILE_NUM_DELAYED_MESSAGES && sz + msgs.size () >= CHECK_PROFILE_NUM_DELAYED_MESSAGES)
|
||||
{
|
||||
auto profile = i2p::data::GetRouterProfile (ident);
|
||||
if (profile && profile->IsUnreachable ())
|
||||
if (i2p::data::IsRouterBanned (ident))
|
||||
{
|
||||
LogPrint (eLogWarning, "Transports: Peer profile for ", ident.ToBase64 (), " reports unreachable. Dropped");
|
||||
LogPrint (eLogWarning, "Transports: Router ", ident.ToBase64 (), " is banned. Peer dropped");
|
||||
std::unique_lock<std::mutex> l(m_PeersMutex);
|
||||
m_Peers.erase (it);
|
||||
return;
|
||||
@ -589,6 +589,14 @@ namespace transport
|
||||
m_Peers.erase (ident);
|
||||
return false;
|
||||
}
|
||||
else if (i2p::data::IsRouterBanned (ident))
|
||||
{
|
||||
LogPrint (eLogWarning, "Transports: Router ", ident.ToBase64 (), " is banned. Peer dropped");
|
||||
peer.Done ();
|
||||
std::unique_lock<std::mutex> l(m_PeersMutex);
|
||||
m_Peers.erase (ident);
|
||||
return false;
|
||||
}
|
||||
else // otherwise request RI
|
||||
{
|
||||
LogPrint (eLogInfo, "Transports: RouterInfo for ", ident.ToBase64 (), " not found, requested");
|
||||
|
Loading…
x
Reference in New Issue
Block a user