From 78b1afcc8c34eb06906e118a8d53684e10b63673 Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 26 Apr 2022 15:20:57 -0400 Subject: [PATCH] publish introducer cap for SSU2 address --- libi2pd/RouterContext.cpp | 4 ++++ libi2pd/RouterInfo.cpp | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/libi2pd/RouterContext.cpp b/libi2pd/RouterContext.cpp index 588d5c23..3c0273f0 100644 --- a/libi2pd/RouterContext.cpp +++ b/libi2pd/RouterContext.cpp @@ -338,6 +338,10 @@ namespace i2p { address->port = port; address->published = publish; + if (publish) + address->caps |= i2p::data::RouterInfo::eSSUIntroducer; + else + address->caps &= ~i2p::data::RouterInfo::eSSUIntroducer; updated = true; } } diff --git a/libi2pd/RouterInfo.cpp b/libi2pd/RouterInfo.cpp index c6220037..87120bdd 100644 --- a/libi2pd/RouterInfo.cpp +++ b/libi2pd/RouterInfo.cpp @@ -1205,17 +1205,23 @@ namespace data else if (address.transportStyle == eTransportSSU2) { WriteString ("SSU2", s); + // caps + std::string caps; if (address.published) + { isPublished = true; + if (address.IsIntroducer ()) caps += CAPS_FLAG_SSU_INTRODUCER; + } else { - // caps - WriteString ("caps", properties); - properties << '='; - std::string caps; if (address.IsV4 ()) caps += CAPS_FLAG_V4; if (address.IsV6 ()) caps += CAPS_FLAG_V6; if (caps.empty ()) caps += CAPS_FLAG_V4; + } + if (!caps.empty ()) + { + WriteString ("caps", properties); + properties << '='; WriteString (caps, properties); properties << ';'; }