mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Detect "radio silence"
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
|
||||
protected:
|
||||
OperatingMode mMode;
|
||||
boost::posix_time::ptime mConnectTime;
|
||||
boost::asio::deadline_timer mNetTimer;
|
||||
boost::shared_ptr<LedgerConsensus> mConsensus;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user