mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
common rng for random shuffle
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user