mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
use Rng from pool if possible
This commit is contained in:
parent
8cf9cc1a01
commit
509c039e2f
3 changed files with 15 additions and 5 deletions
|
@ -422,7 +422,7 @@ namespace datagram
|
|||
{
|
||||
auto pool = m_LocalDestination->GetTunnelPool ();
|
||||
if (pool)
|
||||
idx = m_LocalDestination->GetTunnelPool ()->GetRng ()() % sz;
|
||||
idx = pool->GetRng ()() % sz;
|
||||
}
|
||||
if (idx < 0) idx = rand () % sz;
|
||||
path->remoteLease = ls[idx];
|
||||
|
@ -455,7 +455,7 @@ namespace datagram
|
|||
{
|
||||
auto pool = m_LocalDestination->GetTunnelPool ();
|
||||
if (pool)
|
||||
idx = m_LocalDestination->GetTunnelPool ()->GetRng ()() % sz;
|
||||
idx = pool->GetRng ()() % sz;
|
||||
}
|
||||
if (idx < 0) idx = rand () % sz;
|
||||
path->remoteLease = ls[idx];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue