Detect "radio silence"

This commit is contained in:
JoelKatz
2012-07-09 10:42:44 -07:00
parent 82acac809f
commit f5783820f8
2 changed files with 5 additions and 2 deletions

View File

@@ -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)

View File

@@ -46,6 +46,7 @@ public:
protected:
OperatingMode mMode;
boost::posix_time::ptime mConnectTime;
boost::asio::deadline_timer mNetTimer;
boost::shared_ptr<LedgerConsensus> mConsensus;