Merge branch 'cache_snapshot' into develop

This commit is contained in:
JoelKatz
2013-05-20 11:56:36 -07:00
5 changed files with 26 additions and 15 deletions

View File

@@ -18,6 +18,14 @@ uint32 LedgerMaster::getCurrentLedgerIndex()
return mCurrentLedger->getLedgerSeq();
}
Ledger::ref LedgerMaster::getCurrentSnapshot()
{
if (!mCurrentSnapshot || (mCurrentSnapshot->getHash() != mCurrentLedger->getHash()))
mCurrentSnapshot = boost::make_shared<Ledger>(boost::ref(*mCurrentLedger), false);
assert(mCurrentSnapshot->isImmutable());
return mCurrentSnapshot;
}
void LedgerMaster::addHeldTransaction(Transaction::ref transaction)
{ // returns true if transaction was added
boost::recursive_mutex::scoped_lock ml(mLock);