|
|
@ -408,7 +408,7 @@ namespace transport |
|
|
|
return it->second; |
|
|
|
return it->second; |
|
|
|
it++; |
|
|
|
it++; |
|
|
|
} |
|
|
|
} |
|
|
|
// not found, try from begining
|
|
|
|
// not found, try from beginning
|
|
|
|
it = m_Sessions.begin (); |
|
|
|
it = m_Sessions.begin (); |
|
|
|
while (it != m_Sessions.end () && ind) |
|
|
|
while (it != m_Sessions.end () && ind) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -654,14 +654,14 @@ namespace transport |
|
|
|
uint32_t relayTag = 0; |
|
|
|
uint32_t relayTag = 0; |
|
|
|
if (!address->ssu->introducers.empty ()) |
|
|
|
if (!address->ssu->introducers.empty ()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::vector<int> indicies; |
|
|
|
std::vector<int> indices; |
|
|
|
for (int i = 0; i < (int)address->ssu->introducers.size (); i++) indicies.push_back(i); |
|
|
|
for (int i = 0; i < (int)address->ssu->introducers.size (); i++) indices.push_back(i); |
|
|
|
if (indicies.size () > 1) |
|
|
|
if (indices.size () > 1) |
|
|
|
std::shuffle (indicies.begin(), indicies.end(), std::mt19937(std::random_device()())); |
|
|
|
std::shuffle (indices.begin(), indices.end(), std::mt19937(std::random_device()())); |
|
|
|
|
|
|
|
|
|
|
|
for (auto i: indicies) |
|
|
|
for (auto i: indices) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const auto& introducer = address->ssu->introducers[indicies[i]]; |
|
|
|
const auto& introducer = address->ssu->introducers[indices[i]]; |
|
|
|
if (introducer.iTag && ts < introducer.iExp) |
|
|
|
if (introducer.iTag && ts < introducer.iExp) |
|
|
|
{ |
|
|
|
{ |
|
|
|
r = i2p::data::netdb.FindRouter (introducer.iH); |
|
|
|
r = i2p::data::netdb.FindRouter (introducer.iH); |
|
|
|