add option to only connect to certain routers

This commit is contained in:
Jeff Becker 2016-10-28 12:50:26 -04:00
parent 5c64c2ff42
commit 5f396d6311
No known key found for this signature in database
GPG key ID: AB950234D6EA286B
6 changed files with 130 additions and 26 deletions

View file

@ -110,7 +110,11 @@ namespace transport
/** do we want to use restricted routes? */
bool RoutesRestricted() const;
/** restrict routes to use only these router families for first hops */
void RestrictRoutes(std::vector<std::string> families);
void RestrictRoutesToFamilies(std::set<std::string> families);
/** restrict routes to use only these routers for first hops */
void RestrictRoutesToRouters(std::set<i2p::data::IdentHash> routers);
bool IsRestrictedPeer(const i2p::data::IdentHash & ident) const;
void PeerTest ();
@ -157,6 +161,10 @@ namespace transport
/** which router families to trust for first hops */
std::vector<std::string> m_TrustedFamilies;
mutable std::mutex m_FamilyMutex;
/** which routers for first hop to trust */
std::vector<i2p::data::IdentHash> m_TrustedRouters;
mutable std::mutex m_TrustedRoutersMutex;
public: