From b6bfd66a49290950316163623eeacb4070427b47 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 6 Feb 2019 21:19:44 -0500 Subject: [PATCH] use identity from LeaseSet --- libi2pd/Streaming.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libi2pd/Streaming.cpp b/libi2pd/Streaming.cpp index 1e10a6ad..76d1e91f 100644 --- a/libi2pd/Streaming.cpp +++ b/libi2pd/Streaming.cpp @@ -263,7 +263,9 @@ namespace stream if (flags & PACKET_FLAG_FROM_INCLUDED) { - m_RemoteIdentity = std::make_shared(optionData, optionSize); + if (m_RemoteLeaseSet) m_RemoteIdentity = m_RemoteLeaseSet->GetIdentity (); + if (!m_RemoteIdentity) + m_RemoteIdentity = std::make_shared(optionData, optionSize); if (m_RemoteIdentity->IsRSA ()) { LogPrint (eLogInfo, "Streaming: Incoming stream from RSA destination ", m_RemoteIdentity->GetIdentHash ().ToBase64 (), " Discarded"); @@ -891,6 +893,12 @@ namespace stream LogPrint (eLogWarning, "Streaming: LeaseSet ", m_RemoteIdentity->GetIdentHash ().ToBase64 (), " not found"); m_LocalDestination.GetOwner ()->RequestDestination (m_RemoteIdentity->GetIdentHash ()); // try to request for a next attempt } + else + { + // LeaseSet updated + m_RemoteIdentity = m_RemoteLeaseSet->GetIdentity (); + m_TransientVerifier = m_RemoteLeaseSet->GetTransientVerifier (); + } } if (m_RemoteLeaseSet) {