mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
use rng from pool for lease selection
This commit is contained in:
parent
bbadbdbfdb
commit
a837e5c502
|
@ -226,7 +226,8 @@ namespace client
|
|||
leases = remote->GetNonExpiredLeases (true); // with threshold
|
||||
if (!leases.empty ())
|
||||
{
|
||||
remoteLease = leases[rand () % leases.size ()];
|
||||
auto pool = GetTunnelPool ();
|
||||
remoteLease = leases[(pool ? pool->GetRng ()() : rand ()) % leases.size ()];
|
||||
auto leaseRouter = i2p::data::netdb.FindRouter (remoteLease->tunnelGateway);
|
||||
outboundTunnel = GetTunnelPool ()->GetNextOutboundTunnel (nullptr,
|
||||
leaseRouter ? leaseRouter->GetCompatibleTransports (false) : (i2p::data::RouterInfo::CompatibleTransports)i2p::data::RouterInfo::eAllTransports);
|
||||
|
|
Loading…
Reference in a new issue