Prevent the timer from firing slightly early.

This commit is contained in:
JoelKatz
2012-05-08 16:03:58 -07:00
parent 04ff77319e
commit facc2fb7df

View File

@@ -160,8 +160,8 @@ void NetworkOPs::setStateTimer(int sec)
uint64 closedTime = theApp->getMasterLedger().getCurrentLedger()->getCloseTimeNC();
uint64 now = getNetworkTimeNC();
if (now > closedTime) sec = 0;
if (sec > (closedTime - now)) sec = (closedTime - now);
if (now >= closedTime) sec = 0;
else if (sec > (closedTime - now)) sec = (closedTime - now);
mNetTimer.expires_from_now(boost::posix_time::seconds(sec));
mNetTimer.async_wait(boost::bind(&NetworkOPs::checkState, this));