| 391 | } |
| 392 | |
| 393 | bool ClientContext::ReplaceLocalDestinationHash (const i2p::data::IdentHash& oldIdentHash, const i2p::data::IdentHash& newIdentHash) |
| 394 | { |
| 395 | std::unique_lock<std::mutex> l(m_DestinationsMutex); |
| 396 | auto it = m_Destinations.find (oldIdentHash); |
| 397 | if (it == m_Destinations.end ()) return false; |
| 398 | auto dest = it->second; |
| 399 | if (!dest) return false; |
| 400 | m_Destinations.erase (it); |
| 401 | m_Destinations.emplace (newIdentHash, dest); |
| 402 | return true; |
| 403 | } |
| 404 | |
| 405 | |
| 406 | std::shared_ptr<ClientDestination> ClientContext::CreateNewLocalDestination (const i2p::data::PrivateKeys& keys, bool isPublic, |