diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-07 19:32:26 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-07 19:32:26 -0700 |
commit | 6de799621809a53b76d47549ffbb37dd567827a7 (patch) | |
tree | 2a738e3bd780d772383a6e5675a9cb035323b61b | |
parent | 49f031ccb4d518e8a715777f5d848759bae0def8 (diff) | |
download | infinitytier-6de799621809a53b76d47549ffbb37dd567827a7.tar.gz infinitytier-6de799621809a53b76d47549ffbb37dd567827a7.zip |
Math fix.
-rw-r--r-- | node/Node.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/node/Node.cpp b/node/Node.cpp index e8a737fe..4699e1b4 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -232,7 +232,7 @@ ZT1_ResultCode Node::processBackgroundTasks(uint64_t now,uint64_t *nextBackgroun _PingPeersThatNeedPing pfunc(RR,now); RR->topology->eachPeer<_PingPeersThatNeedPing &>(pfunc); - _coreDesperation = (unsigned int)(std::max(_startTimeAfterInactivity,pfunc.lastReceiveFromSupernode) / (ZT_PING_CHECK_INVERVAL * ZT_CORE_DESPERATION_INCREMENT)); + _coreDesperation = (unsigned int)((now - std::max(_startTimeAfterInactivity,pfunc.lastReceiveFromSupernode)) / (ZT_PING_CHECK_INVERVAL * ZT_CORE_DESPERATION_INCREMENT)); } catch ( ... ) { return ZT1_RESULT_FATAL_ERROR_INTERNAL; } |