From 6db7c5733d5560c10714bea71ddacc354ac2e84d Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 20 Dec 2017 11:38:35 -0500 Subject: [PATCH] use outbound.nickname as tunnel name if inbound.nickname is not set --- libi2pd/Destination.cpp | 8 +++++++- libi2pd/Destination.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libi2pd/Destination.cpp b/libi2pd/Destination.cpp index 0c3a1512..cb42e480 100644 --- a/libi2pd/Destination.cpp +++ b/libi2pd/Destination.cpp @@ -59,7 +59,13 @@ namespace client } } it = params->find (I2CP_PARAM_INBOUND_NICKNAME); - if (it != params->end ()) m_Nickname = it->second; // otherwise we set deafult nickname in Start when we know local address + if (it != params->end ()) m_Nickname = it->second; + else // try outbound + { + it = params->find (I2CP_PARAM_OUTBOUND_NICKNAME); + if (it != params->end ()) m_Nickname = it->second; + // otherwise we set deafult nickname in Start when we know local address + } } } catch (std::exception & ex) diff --git a/libi2pd/Destination.h b/libi2pd/Destination.h index d3122b3b..17daecb5 100644 --- a/libi2pd/Destination.h +++ b/libi2pd/Destination.h @@ -51,6 +51,7 @@ namespace client const char I2CP_PARAM_TAGS_TO_SEND[] = "crypto.tagsToSend"; const int DEFAULT_TAGS_TO_SEND = 40; const char I2CP_PARAM_INBOUND_NICKNAME[] = "inbound.nickname"; + const char I2CP_PARAM_OUTBOUND_NICKNAME[] = "outbound.nickname"; // latency const char I2CP_PARAM_MIN_TUNNEL_LATENCY[] = "latency.min";