diff --git a/src/Application.cpp b/src/Application.cpp index c78427d7b2..00aea956aa 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -35,14 +35,8 @@ DatabaseCon::~DatabaseCon() delete mDatabase; } -static void resetTimer(boost::asio::deadline_timer* timer) -{ // ugly workaround for Boost IO service weirdness - timer->expires_from_now(boost::posix_time::hours(24)); - timer->async_wait(boost::bind(resetTimer, timer)); -} - Application::Application() : - mIOTimer(mIOService), mAuxTimer(mAuxService), mUNL(mIOService), + mIOWork(mIOService), mAuxWork(mAuxService), mUNL(mIOService), mNetOps(mIOService, &mMasterLedger), mTempNodeCache(16384, 90), mHashedObjectStore(16384, 300), mSNTPClient(mAuxService), mRpcDB(NULL), mTxnDB(NULL), mLedgerDB(NULL), mWalletDB(NULL), mHashNodeDB(NULL), mNetNodeDB(NULL), @@ -50,9 +44,6 @@ Application::Application() : { RAND_bytes(mNonce256.begin(), mNonce256.size()); RAND_bytes(reinterpret_cast(&mNonceST), sizeof(mNonceST)); - - resetTimer(&mIOTimer); - resetTimer(&mAuxTimer); } extern const char *RpcDBInit[], *TxnDBInit[], *LedgerDBInit[], *WalletDBInit[], *HashNodeDBInit[], *NetNodeDBInit[]; @@ -60,10 +51,10 @@ extern int RpcDBCount, TxnDBCount, LedgerDBCount, WalletDBCount, HashNodeDBCount void Application::stop() { - mAuxService.stop(); mIOService.stop(); mHashedObjectStore.bulkWrite(); mValidations.flush(); + mAuxService.stop(); Log(lsINFO) << "Stopped: " << mIOService.stopped(); } diff --git a/src/Application.h b/src/Application.h index 78fc2e425c..8ab7f83ed2 100644 --- a/src/Application.h +++ b/src/Application.h @@ -39,8 +39,8 @@ public: class Application { - boost::asio::io_service mIOService, mAuxService; - boost::asio::deadline_timer mIOTimer, mAuxTimer; + boost::asio::io_service mIOService, mAuxService; + boost::asio::io_service::work mIOWork, mAuxWork; Wallet mWallet; UniqueNodeList mUNL;