From b67424643da459c633c8615388dbe67f6d454d3b Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 27 Aug 2018 18:56:57 -0400 Subject: [PATCH] done insert NTCP2 ipv6 address twice --- libi2pd/RouterContext.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libi2pd/RouterContext.cpp b/libi2pd/RouterContext.cpp index fd59bd83..6ad3d159 100644 --- a/libi2pd/RouterContext.cpp +++ b/libi2pd/RouterContext.cpp @@ -455,7 +455,7 @@ namespace i2p void RouterContext::UpdateNTCP2V6Address (const boost::asio::ip::address& host) { - bool updated = false; + bool updated = false, found = false; int port = 0; auto& addresses = m_RouterInfo.GetAddresses (); for (auto& addr: addresses) @@ -468,15 +468,16 @@ namespace i2p { addr->host = host; updated = true; - break; } + found = true; + break; } else 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); updated = true;