take tunnels from exploratory pool only

This commit is contained in:
orignal 2014-12-27 20:36:32 -05:00
parent da01ea997d
commit 86a7f96a46
2 changed files with 19 additions and 25 deletions

13
NetDb.h
View file

@ -24,17 +24,14 @@ namespace data
{
public:
RequestedDestination (const IdentHash& destination, bool isExploratory = false,
i2p::tunnel::TunnelPool * pool = nullptr):
m_Destination (destination), m_IsExploratory (isExploratory),
m_Pool (pool), m_CreationTime (0) {};
RequestedDestination (const IdentHash& destination, bool isExploratory = false):
m_Destination (destination), m_IsExploratory (isExploratory), m_CreationTime (0) {};
const IdentHash& GetDestination () const { return m_Destination; };
int GetNumExcludedPeers () const { return m_ExcludedPeers.size (); };
const std::set<IdentHash>& GetExcludedPeers () { return m_ExcludedPeers; };
void ClearExcludedPeers ();
std::shared_ptr<const RouterInfo> GetLastRouter () const { return m_LastRouter; };
i2p::tunnel::TunnelPool * GetTunnelPool () { return m_Pool; };
bool IsExploratory () const { return m_IsExploratory; };
bool IsExcluded (const IdentHash& ident) const { return m_ExcludedPeers.count (ident); };
uint64_t GetCreationTime () const { return m_CreationTime; };
@ -45,7 +42,6 @@ namespace data
IdentHash m_Destination;
bool m_IsExploratory;
i2p::tunnel::TunnelPool * m_Pool;
std::set<IdentHash> m_ExcludedPeers;
std::shared_ptr<const RouterInfo> m_LastRouter;
uint64_t m_CreationTime;
@ -67,7 +63,7 @@ namespace data
std::shared_ptr<RouterInfo> FindRouter (const IdentHash& ident) const;
LeaseSet * FindLeaseSet (const IdentHash& destination) const;
void RequestDestination (const IdentHash& destination, i2p::tunnel::TunnelPool * pool = nullptr);
void RequestDestination (const IdentHash& destination);
void HandleDatabaseStoreMsg (I2NPMessage * msg);
void HandleDatabaseSearchReplyMsg (I2NPMessage * msg);
@ -97,8 +93,7 @@ namespace data
void ManageLeaseSets ();
void ManageRequests ();
RequestedDestination * CreateRequestedDestination (const IdentHash& dest,
bool isExploratory = false, i2p::tunnel::TunnelPool * pool = nullptr);
RequestedDestination * CreateRequestedDestination (const IdentHash& dest, bool isExploratory = false);
bool DeleteRequestedDestination (const IdentHash& dest); // returns true if found
void DeleteRequestedDestination (RequestedDestination * dest);