mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
fixed race condition
This commit is contained in:
parent
78fc3876e6
commit
0f3a68cd8e
4 changed files with 11 additions and 0 deletions
|
@ -182,7 +182,10 @@ namespace data
|
|||
RouterInfo * r = new RouterInfo (buf, len);
|
||||
m_RouterInfos[r->GetIdentHash ()] = r;
|
||||
if (r->IsFloodfill ())
|
||||
{
|
||||
std::unique_lock<std::mutex> l(m_FloodfillsMutex);
|
||||
m_Floodfills.push_back (r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -852,6 +855,7 @@ namespace data
|
|||
XORMetric minMetric;
|
||||
RoutingKey destKey = CreateRoutingKey (destination);
|
||||
minMetric.SetMax ();
|
||||
std::unique_lock<std::mutex> l(m_FloodfillsMutex);
|
||||
for (auto it: m_Floodfills)
|
||||
{
|
||||
if (!it->IsUnreachable () && !excluded.count (it->GetIdentHash ()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue