mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
mutex for encrypted LeaseSet update
This commit is contained in:
parent
70fec2bc99
commit
86dbfdb536
@ -467,12 +467,15 @@ namespace client
|
|||||||
{
|
{
|
||||||
auto ls2 = std::make_shared<i2p::data::LeaseSet2> (buf + offset, len - offset,
|
auto ls2 = std::make_shared<i2p::data::LeaseSet2> (buf + offset, len - offset,
|
||||||
it2->second->requestedBlindedKey, m_LeaseSetPrivKey ? ((const uint8_t *)*m_LeaseSetPrivKey) : nullptr , GetPreferredCryptoType ());
|
it2->second->requestedBlindedKey, m_LeaseSetPrivKey ? ((const uint8_t *)*m_LeaseSetPrivKey) : nullptr , GetPreferredCryptoType ());
|
||||||
if (ls2->IsValid ())
|
if (ls2->IsValid () && !ls2->IsExpired ())
|
||||||
{
|
{
|
||||||
|
leaseSet = ls2;
|
||||||
|
std::lock_guard<std::mutex> lock(m_RemoteLeaseSetsMutex);
|
||||||
m_RemoteLeaseSets[ls2->GetIdentHash ()] = ls2; // ident is not key
|
m_RemoteLeaseSets[ls2->GetIdentHash ()] = ls2; // ident is not key
|
||||||
m_RemoteLeaseSets[key] = ls2; // also store as key for next lookup
|
m_RemoteLeaseSets[key] = ls2; // also store as key for next lookup
|
||||||
leaseSet = ls2;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
LogPrint (eLogError, "Destination: New remote encrypted LeaseSet2 failed");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LogPrint (eLogInfo, "Destination: Couldn't find request for encrypted LeaseSet2");
|
LogPrint (eLogInfo, "Destination: Couldn't find request for encrypted LeaseSet2");
|
||||||
|
Loading…
Reference in New Issue
Block a user