mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
replaced GetIdentHash by GetAddress
This commit is contained in:
parent
8774a8fbc2
commit
f5ab8f2062
8 changed files with 75 additions and 86 deletions
|
@ -810,9 +810,9 @@ namespace client
|
|||
|
||||
void I2PUDPClientTunnel::TryResolving() {
|
||||
LogPrint(eLogInfo, "UDP Tunnel: Trying to resolve ", m_RemoteDest);
|
||||
i2p::data::IdentHash * h = new i2p::data::IdentHash;
|
||||
|
||||
while(!context.GetAddressBook().GetIdentHash(m_RemoteDest, *h) && !m_cancel_resolve)
|
||||
std::shared_ptr<const Address> addr;
|
||||
while(!(addr = context.GetAddressBook().GetAddress(m_RemoteDest)) && !m_cancel_resolve)
|
||||
{
|
||||
LogPrint(eLogWarning, "UDP Tunnel: failed to lookup ", m_RemoteDest);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
|
@ -822,7 +822,13 @@ namespace client
|
|||
LogPrint(eLogError, "UDP Tunnel: lookup of ", m_RemoteDest, " was cancelled");
|
||||
return;
|
||||
}
|
||||
m_RemoteIdent = h;
|
||||
if (!addr || !addr->IsIdentHash ())
|
||||
{
|
||||
LogPrint(eLogError, "UDP Tunnel: ", m_RemoteDest, " not found");
|
||||
return;
|
||||
}
|
||||
m_RemoteIdent = new i2p::data::IdentHash;
|
||||
*m_RemoteIdent = addr->identHash;
|
||||
LogPrint(eLogInfo, "UDP Tunnel: resolved ", m_RemoteDest, " to ", m_RemoteIdent->ToBase32());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue