From f5f282af97a6c97398876ded0086885999227dfc Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 2 Apr 2022 14:32:26 -0400 Subject: [PATCH] cost for published SSU2 address --- libi2pd/RouterInfo.cpp | 2 +- libi2pd/RouterInfo.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libi2pd/RouterInfo.cpp b/libi2pd/RouterInfo.cpp index e9eb1478..c1f5379f 100644 --- a/libi2pd/RouterInfo.cpp +++ b/libi2pd/RouterInfo.cpp @@ -1135,7 +1135,7 @@ namespace data else if (address.transportStyle == eTransportSSU) cost = address.published ? COST_SSU_DIRECT : COST_SSU_THROUGH_INTRODUCERS; else if (address.transportStyle == eTransportSSU2) - cost = COST_SSU2_NON_PUBLISHED; // TODO + cost = address.published ? COST_SSU2_DIRECT : COST_SSU2_NON_PUBLISHED; s.write ((const char *)&cost, sizeof (cost)); s.write ((const char *)&address.date, sizeof (address.date)); std::stringstream properties; diff --git a/libi2pd/RouterInfo.h b/libi2pd/RouterInfo.h index 0fdd4478..c9862c99 100644 --- a/libi2pd/RouterInfo.h +++ b/libi2pd/RouterInfo.h @@ -52,6 +52,7 @@ namespace data const uint8_t COST_NTCP2_PUBLISHED = 3; const uint8_t COST_NTCP2_NON_PUBLISHED = 14; + const uint8_t COST_SSU2_DIRECT = 8; const uint8_t COST_SSU_DIRECT = 9; const uint8_t COST_SSU_THROUGH_INTRODUCERS = 11; const uint8_t COST_SSU2_NON_PUBLISHED = 15;