mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Don't run the timer routine of the timer was cancelled/aborted.
This commit is contained in:
@@ -159,7 +159,7 @@ void NetworkOPs::setStateTimer(int sec)
|
||||
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));
|
||||
mNetTimer.async_wait(boost::bind(&NetworkOPs::checkState, this, boost::asio::placeholders::error));
|
||||
}
|
||||
|
||||
class ValidationCount
|
||||
@@ -181,8 +181,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void NetworkOPs::checkState()
|
||||
void NetworkOPs::checkState(const boost::system::error_code& result)
|
||||
{ // Network state machine
|
||||
if (result == boost::asio::error::operation_aborted)
|
||||
return;
|
||||
|
||||
std::vector<Peer::pointer> peerList = theApp->getConnectionPool().getPeerVector();
|
||||
|
||||
// do we have sufficient peers? If not, we are disconnected.
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
const std::vector<unsigned char>& myNode, std::list<std::vector<unsigned char> >& newNodes);
|
||||
|
||||
// network state machine
|
||||
void checkState();
|
||||
void checkState(const boost::system::error_code& result);
|
||||
void switchLastClosedLedger(Ledger::pointer newLedger, bool normal);
|
||||
void setStateTimer(int seconds);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user