mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
don't insert Yggdrasil address twice
This commit is contained in:
parent
c4fc0f4ecf
commit
fef4f13b8f
|
@ -529,16 +529,19 @@ namespace i2p
|
||||||
uint16_t port = 0;
|
uint16_t port = 0;
|
||||||
i2p::config::GetOption ("ntcp2.port", port);
|
i2p::config::GetOption ("ntcp2.port", port);
|
||||||
if (!port) i2p::config::GetOption("port", port);
|
if (!port) i2p::config::GetOption("port", port);
|
||||||
if (!port)
|
bool foundMesh = false;
|
||||||
{
|
auto& addresses = m_RouterInfo.GetAddresses ();
|
||||||
auto& addresses = m_RouterInfo.GetAddresses ();
|
for (auto& addr: addresses)
|
||||||
for (auto& addr: addresses)
|
{
|
||||||
|
if (!port) port = addr->port;
|
||||||
|
if (i2p::util::net::IsYggdrasilAddress (addr->host))
|
||||||
{
|
{
|
||||||
port = addr->port;
|
foundMesh = true;
|
||||||
if (port) break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, host, port);
|
if (!foundMesh)
|
||||||
|
m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, host, port);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_RouterInfo.DisableMesh ();
|
m_RouterInfo.DisableMesh ();
|
||||||
|
|
Loading…
Reference in a new issue