1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-31 00:34:20 +00:00

done insert NTCP2 ipv6 address twice

This commit is contained in:
orignal 2018-08-27 18:56:57 -04:00
parent 575a4c01c9
commit b67424643d

View File

@ -455,7 +455,7 @@ namespace i2p
void RouterContext::UpdateNTCP2V6Address (const boost::asio::ip::address& host) void RouterContext::UpdateNTCP2V6Address (const boost::asio::ip::address& host)
{ {
bool updated = false; bool updated = false, found = false;
int port = 0; int port = 0;
auto& addresses = m_RouterInfo.GetAddresses (); auto& addresses = m_RouterInfo.GetAddresses ();
for (auto& addr: addresses) for (auto& addr: addresses)
@ -468,15 +468,16 @@ namespace i2p
{ {
addr->host = host; addr->host = host;
updated = true; updated = true;
break;
} }
found = true;
break;
} }
else else
port = addr->port; // NTCP2 v4 port = addr->port; // NTCP2 v4
} }
} }
if (!updated && port) // we have found NTCP2 v4 but not v6 if (!found && port) // we have found NTCP2 v4 but not v6
{ {
m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, host, port); m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, host, port);
updated = true; updated = true;