From 11a120150639c1f10a1afdf6bffa60524436b606 Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 14 Sep 2014 21:53:00 -0400 Subject: [PATCH] check if remote RouterInfo is presented --- RouterContext.cpp | 2 +- SSU.cpp | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/RouterContext.cpp b/RouterContext.cpp index 9384a0bd..27e21544 100644 --- a/RouterContext.cpp +++ b/RouterContext.cpp @@ -98,7 +98,7 @@ namespace i2p if (ret) UpdateRouterInfo (); } - return true; + return ret; } void RouterContext::RemoveIntroducer (const boost::asio::ip::udp::endpoint& e) diff --git a/SSU.cpp b/SSU.cpp index db97fe00..77885e89 100644 --- a/SSU.cpp +++ b/SSU.cpp @@ -1086,11 +1086,6 @@ namespace ssu { session->Close (); m_Sessions.erase (session->GetRemoteEndpoint ()); - if (session->GetRelayTag () && i2p::context.GetRouterInfo ().UsesIntroducer ()) - { - m_Introducers.remove (session->GetRemoteEndpoint ()); - i2p::context.RemoveIntroducer (session->GetRemoteEndpoint ()); - } delete session; } } @@ -1189,7 +1184,8 @@ namespace ssu { for (auto it1: introducers) { - if (i2p::context.AddIntroducer (*it1->GetRemoteRouter (), it1->GetRelayTag ())) + auto router = it1->GetRemoteRouter (); + if (router && i2p::context.AddIntroducer (*router, it1->GetRelayTag ())) { newList.push_back (it1->GetRemoteEndpoint ()); if (newList.size () >= SSU_MAX_NUM_INTRODUCERS) break;