Add "syncing" state.

This commit is contained in:
JoelKatz
2013-05-23 18:46:39 -07:00
parent 68c8162a87
commit 576ee472bf
5 changed files with 30 additions and 13 deletions

View File

@@ -26,6 +26,22 @@ Ledger::ref LedgerMaster::getCurrentSnapshot()
return mCurrentSnapshot;
}
int LedgerMaster::getValidatedLedgerAge()
{
if (!mValidLedger)
{
cLog(lsINFO) << "No validated ledger";
return 999999;
}
int64 ret = theApp->getOPs().getCloseTimeNC();
ret -= static_cast<int64>(mValidLedger->getCloseTimeNC());
ret = std::max(0LL, ret);
cLog(lsINFO) << "Validated ledger age is " << ret;
return static_cast<int>(ret);
}
void LedgerMaster::addHeldTransaction(Transaction::ref transaction)
{ // returns true if transaction was added
boost::recursive_mutex::scoped_lock ml(mLock);