publish NTCP2 address

This commit is contained in:
orignal 2018-07-23 13:51:29 -04:00
parent c8f51380e6
commit 1a38e925bf
3 changed files with 26 additions and 5 deletions

View file

@ -146,7 +146,7 @@ namespace i2p
bool updated = false;
for (auto& address : m_RouterInfo.GetAddresses ())
{
if (address->port != port)
if (!address->IsNTCP2 () && address->port != port)
{
address->port = port;
updated = true;
@ -156,6 +156,22 @@ namespace i2p
UpdateRouterInfo ();
}
void RouterContext::PublishNTCP2Address (int port)
{
bool updated = false;
for (auto& address : m_RouterInfo.GetAddresses ())
{
if (address->IsNTCP2 () && address->port != port)
{
address->port = port;
address->ntcp2->isPublished = true;
updated = true;
}
}
if (updated)
UpdateRouterInfo ();
}
void RouterContext::UpdateAddress (const boost::asio::ip::address& host)
{
bool updated = false;