mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
use any router for second hop of tunnel
This commit is contained in:
parent
9e91be671d
commit
bd8ea0bac0
2 changed files with 9 additions and 7 deletions
|
@ -499,12 +499,15 @@ namespace data
|
|||
{
|
||||
CryptoPP::RandomNumberGenerator& rnd = i2p::context.GetRandomNumberGenerator ();
|
||||
uint32_t ind = rnd.GenerateWord32 (0, m_RouterInfos.size () - 1), i = 0;
|
||||
RouterInfo * last = nullptr;
|
||||
for (auto it: m_RouterInfos)
|
||||
{
|
||||
if (i >= ind) return it.second;
|
||||
if (!it.second->IsUnreachable ())
|
||||
last = it.second;
|
||||
if (i >= ind) break;
|
||||
else i++;
|
||||
}
|
||||
return nullptr;
|
||||
return last;
|
||||
}
|
||||
|
||||
void NetDb::PostI2NPMsg (I2NPMessage * msg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue