mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Prevent the timer from firing slightly early.
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user