mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
mutex for request's excluded peers
This commit is contained in:
parent
146b3f52c0
commit
5f39f65540
2 changed files with 11 additions and 2 deletions
|
@ -31,6 +31,7 @@ namespace data
|
|||
std::shared_ptr<I2NPMessage> RequestedDestination::CreateRequestMessage (std::shared_ptr<const RouterInfo> router,
|
||||
std::shared_ptr<const i2p::tunnel::InboundTunnel> replyTunnel)
|
||||
{
|
||||
std::lock_guard<std::mutex> l (m_ExcludedPeerstMutex);
|
||||
std::shared_ptr<I2NPMessage> msg;
|
||||
if(replyTunnel)
|
||||
msg = i2p::CreateRouterInfoDatabaseLookupMsg (m_Destination,
|
||||
|
@ -53,8 +54,15 @@ namespace data
|
|||
return msg;
|
||||
}
|
||||
|
||||
bool RequestedDestination::IsExcluded (const IdentHash& ident) const
|
||||
{
|
||||
std::lock_guard<std::mutex> l (m_ExcludedPeerstMutex);
|
||||
return m_ExcludedPeers.count (ident);
|
||||
}
|
||||
|
||||
void RequestedDestination::ClearExcludedPeers ()
|
||||
{
|
||||
std::lock_guard<std::mutex> l (m_ExcludedPeerstMutex);
|
||||
m_ExcludedPeers.clear ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue