mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Remove LedgerBase and decongest Ledger locks
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
Reference in New Issue
Block a user