More tweaks to algorithm for determining when to fail over to TCP, and stop supernodes from resynchronizing unless explicitly ordered.

This commit is contained in:
Adam Ierymenko 2014-04-01 18:39:10 -07:00
commit 700a450806
6 changed files with 71 additions and 44 deletions

View file

@ -207,11 +207,10 @@ public:
class PingPeersThatNeedPing
{
public:
PingPeersThatNeedPing(const RuntimeEnvironment *renv,uint64_t now,bool firstSinceReset) throw() :
PingPeersThatNeedPing(const RuntimeEnvironment *renv,uint64_t now) throw() :
_now(now),
_supernodeAddresses(renv->topology->supernodeAddresses()),
_r(renv),
_firstSinceReset(firstSinceReset) {}
_r(renv) {}
inline void operator()(Topology &t,const SharedPtr<Peer> &p)
{
@ -228,14 +227,13 @@ public:
/* 2b: peer is not a supernode */
(!_supernodeAddresses.count(p->address()))
)
) { p->sendPing(_r,_now,_firstSinceReset); }
) { p->sendPing(_r,_now); }
}
private:
uint64_t _now;
std::set<Address> _supernodeAddresses;
const RuntimeEnvironment *_r;
bool _firstSinceReset;
};
/**