mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
publish NTCP2 address
This commit is contained in:
parent
c8f51380e6
commit
1a38e925bf
3 changed files with 26 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue