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 @@ -1305,7 +1305,8 @@ namespace transport
if (ecode != boost::asio::error::operation_aborted)
{
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 ();
}
});

2
libi2pd/Transports.cpp

@ -440,7 +440,7 @@ namespace transport @@ -440,7 +440,7 @@ namespace transport
{
// NTCP2 have priority over NTCP
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);

Loading…
Cancel
Save