Add TCP channel support for supernode list, make Peer pick the first path if all paths are equally dead.

This commit is contained in:
Adam Ierymenko 2014-03-26 15:35:15 -07:00
parent 73c1d43f2f
commit daaec84c6b
7 changed files with 46 additions and 38 deletions

View file

@ -63,7 +63,7 @@ public:
*
* @param sn Supernodes for this network
*/
void setSupernodes(const std::map< Identity,std::vector<InetAddress> > &sn);
void setSupernodes(const std::map< Identity,std::vector< std::pair<InetAddress,bool> > > &sn);
/**
* Add a peer to database
@ -103,15 +103,6 @@ public:
*/
void saveIdentity(const Identity &id);
/**
* @return Current network supernodes
*/
inline std::map< Identity,std::vector<InetAddress> > supernodes() const
{
Mutex::Lock _l(_supernodes_m);
return _supernodes;
}
/**
* @return Vector of peers that are supernodes
*/
@ -313,7 +304,7 @@ private:
std::map< Address,SharedPtr<Peer> > _activePeers;
Mutex _activePeers_m;
std::map< Identity,std::vector<InetAddress> > _supernodes;
std::map< Identity,std::vector< std::pair<InetAddress,bool> > > _supernodes;
std::set< Address > _supernodeAddresses;
std::vector< SharedPtr<Peer> > _supernodePeers;
Mutex _supernodes_m;