mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Separate close times and network times.
This commit is contained in:
@@ -24,18 +24,15 @@
|
||||
// there's a functional network.
|
||||
|
||||
NetworkOPs::NetworkOPs(boost::asio::io_service& io_service, LedgerMaster* pLedgerMaster) :
|
||||
mMode(omDISCONNECTED),mNetTimer(io_service), mLedgerMaster(pLedgerMaster), mTimeOffset(0),
|
||||
mMode(omDISCONNECTED),mNetTimer(io_service), mLedgerMaster(pLedgerMaster), mCloseTimeOffset(0),
|
||||
mLastCloseProposers(0), mLastCloseConvergeTime(LEDGER_IDLE_INTERVAL)
|
||||
{
|
||||
}
|
||||
|
||||
boost::posix_time::ptime NetworkOPs::getNetworkTimePT()
|
||||
{
|
||||
int offset;
|
||||
if (theApp->getSystemTimeOffset(offset))
|
||||
offset += mTimeOffset;
|
||||
else
|
||||
offset = mTimeOffset;
|
||||
int offset = 0;
|
||||
theApp->getSystemTimeOffset(offset);
|
||||
return boost::posix_time::second_clock::universal_time() + boost::posix_time::seconds(offset);
|
||||
}
|
||||
|
||||
@@ -44,6 +41,11 @@ uint32 NetworkOPs::getNetworkTimeNC()
|
||||
return iToSeconds(getNetworkTimePT());
|
||||
}
|
||||
|
||||
uint32 NetworkOPs::getCloseTimeNC()
|
||||
{
|
||||
return iToSeconds(getNetworkTimePT() + boost::posix_time::seconds(mCloseTimeOffset));
|
||||
}
|
||||
|
||||
uint32 NetworkOPs::getCurrentLedgerID()
|
||||
{
|
||||
return mLedgerMaster->getCurrentLedger()->getLedgerSeq();
|
||||
|
||||
Reference in New Issue
Block a user