Browse Source

some cleanup

pull/2035/head
orignal 10 months ago
parent
commit
af0d853ccd
  1. 6
      libi2pd/Transports.cpp

6
libi2pd/Transports.cpp

@ -460,9 +460,8 @@ namespace transport
auto it = m_Peers.find (ident); auto it = m_Peers.find (ident);
if (it == m_Peers.end ()) if (it == m_Peers.end ())
{ {
// check if not known as unreachable // check if not banned
auto profile = i2p::data::GetRouterProfile (ident); if (i2p::data::IsRouterBanned (ident)) return; // don't create peer to unreachable router
if (profile && profile->IsUnreachable ()) return; // don't create peer to unreachable router
// try to connect // try to connect
bool connected = false; bool connected = false;
try try
@ -491,7 +490,6 @@ namespace transport
{ {
if (sz < CHECK_PROFILE_NUM_DELAYED_MESSAGES && sz + msgs.size () >= CHECK_PROFILE_NUM_DELAYED_MESSAGES) if (sz < CHECK_PROFILE_NUM_DELAYED_MESSAGES && sz + msgs.size () >= CHECK_PROFILE_NUM_DELAYED_MESSAGES)
{ {
auto profile = i2p::data::GetRouterProfile (ident);
if (i2p::data::IsRouterBanned (ident)) if (i2p::data::IsRouterBanned (ident))
{ {
LogPrint (eLogWarning, "Transports: Router ", ident.ToBase64 (), " is banned. Peer dropped"); LogPrint (eLogWarning, "Transports: Router ", ident.ToBase64 (), " is banned. Peer dropped");

Loading…
Cancel
Save