diff --git a/src/NetworkOPs.cpp b/src/NetworkOPs.cpp index aef5d17bd..37c6c0c32 100644 --- a/src/NetworkOPs.cpp +++ b/src/NetworkOPs.cpp @@ -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 peerList = theApp->getConnectionPool().getPeerVector(); // do we have sufficient peers? If not, we are disconnected. diff --git a/src/NetworkOPs.h b/src/NetworkOPs.h index cdd8eb848..bb1c3c903 100644 --- a/src/NetworkOPs.h +++ b/src/NetworkOPs.h @@ -66,7 +66,7 @@ public: const std::vector& myNode, std::list >& 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);