mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
use Rng from pool if possible
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user