mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
common rng for random shuffle
This commit is contained in:
parent
56619caa71
commit
dddbca6ffb
3 changed files with 10 additions and 7 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <utility>
|
||||
#include <mutex>
|
||||
#include <memory>
|
||||
#include <random>
|
||||
#include "Identity.h"
|
||||
#include "LeaseSet.h"
|
||||
#include "RouterInfo.h"
|
||||
|
@ -115,6 +116,8 @@ namespace tunnel
|
|||
std::shared_ptr<const i2p::data::RouterInfo> SelectNextHop (std::shared_ptr<const i2p::data::RouterInfo> prevHop, bool reverse, bool endpoint) const;
|
||||
bool StandardSelectPeers(Path & path, int numHops, bool inbound, SelectHopFunc nextHop);
|
||||
|
||||
std::mt19937& GetRng () { return m_Rng; }
|
||||
|
||||
private:
|
||||
|
||||
void TestTunnels ();
|
||||
|
@ -148,6 +151,9 @@ namespace tunnel
|
|||
uint64_t m_MinLatency = 0; // if > 0 this tunnel pool will try building tunnels with minimum latency by ms
|
||||
uint64_t m_MaxLatency = 0; // if > 0 this tunnel pool will try building tunnels with maximum latency by ms
|
||||
|
||||
std::random_device m_Rd;
|
||||
std::mt19937 m_Rng;
|
||||
|
||||
public:
|
||||
|
||||
// for HTTP only
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue