1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 04:04:16 +00:00

use shared local destination for lookup if destination is not set

This commit is contained in:
orignal 2016-10-11 13:39:07 -04:00
parent f17df1f16d
commit f0d098d0ef

View File

@ -504,17 +504,12 @@ namespace client
{
LogPrint (eLogDebug, "BOB: lookup ", operand);
i2p::data::IdentHash ident;
if (!context.GetAddressBook ().GetIdentHash (operand, ident) || !m_CurrentDestination)
if (!context.GetAddressBook ().GetIdentHash (operand, ident))
{
SendReplyError ("Address Not found");
return;
}
if (!m_CurrentDestination)
{
SendReplyError ("session not created");
return;
}
auto localDestination = m_CurrentDestination->GetLocalDestination ();
auto localDestination = m_CurrentDestination ? m_CurrentDestination->GetLocalDestination () : i2p::client::context.GetSharedLocalDestination ();
auto leaseSet = localDestination->FindLeaseSet (ident);
if (leaseSet)
SendReplyOK (leaseSet->GetIdentity ()->ToBase64 ().c_str ());