Remove LedgerBase and decongest Ledger locks

This commit is contained in:
Nik Bougalis
2014-07-29 11:42:58 -07:00
parent c2276155bf
commit e5252f90af
4 changed files with 3 additions and 26 deletions

View File

@@ -24,10 +24,6 @@
namespace ripple {
LedgerBase::LedgerBase ()
{
}
Ledger::Ledger (const RippleAddress& masterID, std::uint64_t startAmount)
: mTotCoins (startAmount)
, mLedgerSeq (1) // First Ledger
@@ -1162,8 +1158,6 @@ Json::Value Ledger::getJson (int options)
bool const bFull (options & LEDGER_JSON_FULL);
bool const bExpand (options & LEDGER_JSON_EXPAND);
ScopedLockType sl (mLock);
// DEPRECATED
ledger[jss::seqNum]
= beast::lexicalCastThrow <std::string> (mLedgerSeq);

View File

@@ -46,20 +46,6 @@ enum LedgerStateParms
class SqliteStatement;
class LedgerBase
{
protected:
LedgerBase ();
// VFALCO TODO eliminate the need for friends
friend class TransactionEngine;
friend class Transactor;
typedef RippleRecursiveMutex LockType;
typedef std::lock_guard <LockType> ScopedLockType;
LockType mLock;
};
// VFALCO TODO figure out exactly how this thing works.
// It seems like some ledger database is stored as a global, static in the
// class. But then what is the meaning of a Ledger object? Is this
@@ -73,7 +59,6 @@ protected:
*/
class Ledger
: public std::enable_shared_from_this <Ledger>
, public LedgerBase
, public CountedObject <Ledger>
, public beast::Uncopyable
{

View File

@@ -262,9 +262,6 @@ TER Transactor::apply ()
if (terResult != tesSUCCESS)
return (terResult);
// Restructure this to avoid the dependency on LedgerBase::mLock
Ledger::ScopedLockType sl (mEngine->getLedger ()->mLock);
mTxnAccount = mEngine->entryCache (ltACCOUNT_ROOT,
Ledger::getAccountRootIndex (mTxnAccountID));
calculateFee ();