diff --git a/src/NetworkOPs.cpp b/src/NetworkOPs.cpp index 32fcd0f7c1..3b1abcf5bc 100644 --- a/src/NetworkOPs.cpp +++ b/src/NetworkOPs.cpp @@ -334,8 +334,8 @@ void NetworkOPs::checkState(const boost::system::error_code& result) // check if the ledger is bad enough to go to omTRACKING } - uint64 defaultClose = theApp->getMasterLedger().getCurrentLedger()->getCloseTimeNC(); - uint64 now = theApp->getOPs().getNetworkTimeNC(); +// uint64 defaultClose = theApp->getMasterLedger().getCurrentLedger()->getCloseTimeNC(); +// uint64 now = theApp->getOPs().getNetworkTimeNC(); if (!mConsensus) { // if now is past the ledger's default close time or there are transactions in the current ledger, close if ((theApp->getOPs().getNetworkTimeNC() > theApp->getMasterLedger().getCurrentLedger()->getCloseTimeNC()) @@ -613,6 +613,8 @@ void NetworkOPs::endConsensus() void NetworkOPs::setMode(OperatingMode om) { if (mMode == om) return; + if ((om >= omCONNECTED) && (mMode == omDISCONNECTED)) + mConnectTime = boost::posix_time::second_clock::universal_time(); if (mMode == omFULL) { if (mConsensus) diff --git a/src/NetworkOPs.h b/src/NetworkOPs.h index c9e362d371..a4695fc990 100644 --- a/src/NetworkOPs.h +++ b/src/NetworkOPs.h @@ -46,6 +46,7 @@ public: protected: OperatingMode mMode; + boost::posix_time::ptime mConnectTime; boost::asio::deadline_timer mNetTimer; boost::shared_ptr mConsensus;