diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-10-27 12:21:57 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-10-27 12:21:57 -0700 |
| commit | 0ffbd05c0e14088ddb7eaecba7f19541651e859b (patch) | |
| tree | 4cddb0516fefda576d37d8667aa601d7729b2a2f /node | |
| parent | a1a0ee4edb0933c9b82abad8715def6a63049658 (diff) | |
| download | infinitytier-0ffbd05c0e14088ddb7eaecba7f19541651e859b.tar.gz infinitytier-0ffbd05c0e14088ddb7eaecba7f19541651e859b.zip | |
--wtf; prevent roots from TCP fallback
Diffstat (limited to 'node')
| -rw-r--r-- | node/Node.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/node/Node.cpp b/node/Node.cpp index 2b298903..87871e20 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -321,8 +321,8 @@ ZT_ResultCode Node::processBackgroundTasks(uint64_t now,volatile uint64_t *nextB RR->topology->eachPeer<_PingPeersThatNeedPing &>(pfunc); // Update online status, post status change as event - bool oldOnline = _online; - _online = ((now - pfunc.lastReceiveFromUpstream) < ZT_PEER_ACTIVITY_TIMEOUT); + const bool oldOnline = _online; + _online = (((now - pfunc.lastReceiveFromUpstream) < ZT_PEER_ACTIVITY_TIMEOUT)||(RR->topology->amRoot())); if (oldOnline != _online) postEvent(_online ? ZT_EVENT_ONLINE : ZT_EVENT_OFFLINE); } catch ( ... ) { |
