Browse Source

mark NTCP2 unreachable routers

pull/1542/head
orignal 4 years ago
parent
commit
a0b35ebd3e
  1. 3
      libi2pd/NTCP2.cpp
  2. 2
      libi2pd/Transports.cpp

3
libi2pd/NTCP2.cpp

@ -1305,7 +1305,8 @@ namespace transport
if (ecode != boost::asio::error::operation_aborted) if (ecode != boost::asio::error::operation_aborted)
{ {
LogPrint (eLogInfo, "NTCP2: Not connected in ", timeout, " seconds"); LogPrint (eLogInfo, "NTCP2: Not connected in ", timeout, " seconds");
//i2p::data::netdb.SetUnreachable (conn->GetRemoteIdentity ()->GetIdentHash (), true); if (conn->GetRemoteIdentity ())
i2p::data::netdb.SetUnreachable (conn->GetRemoteIdentity ()->GetIdentHash (), true);
conn->Terminate (); conn->Terminate ();
} }
}); });

2
libi2pd/Transports.cpp

@ -440,7 +440,7 @@ namespace transport
{ {
// NTCP2 have priority over NTCP // NTCP2 have priority over NTCP
auto address = peer.router->GetNTCP2Address (true, !context.SupportsV6 ()); // published only auto address = peer.router->GetNTCP2Address (true, !context.SupportsV6 ()); // published only
if (address) if (address && !peer.router->IsUnreachable ())
{ {
auto s = std::make_shared<NTCP2Session> (*m_NTCP2Server, peer.router); auto s = std::make_shared<NTCP2Session> (*m_NTCP2Server, peer.router);

Loading…
Cancel
Save