diff --git a/src/xrpld/app/ledger/LedgerHistory.cpp b/src/xrpld/app/ledger/LedgerHistory.cpp index dcbd722120..0f12120d00 100644 --- a/src/xrpld/app/ledger/LedgerHistory.cpp +++ b/src/xrpld/app/ledger/LedgerHistory.cpp @@ -56,6 +56,10 @@ LedgerHistory::insert( std::shared_ptr const& ledger, bool validated) { + static unsigned long call_count{0}; + JLOG(j_.debug()) << "LedgerHistory lock stats," + << ", insert, call_count = " << call_count++; + if (!ledger->isImmutable()) LogicError("mutable Ledger in insert"); @@ -74,6 +78,10 @@ LedgerHistory::insert( LedgerHash LedgerHistory::getLedgerHash(LedgerIndex index) { + static unsigned long call_count{0}; + JLOG(j_.debug()) << "LedgerHistory lock stats," + << ", getLedgerHash, call_count = " << call_count++; + if (auto it = mLedgersByIndex.find(index); it != mLedgersByIndex.end()) return it->second; return {}; @@ -82,6 +90,10 @@ LedgerHistory::getLedgerHash(LedgerIndex index) std::shared_ptr LedgerHistory::getLedgerBySeq(LedgerIndex index) { + static unsigned long call_count{0}; + JLOG(j_.debug()) << "LedgerHistory lock stats," + << ", getLedgerBySeq, call_count = " << call_count++; + { auto it = mLedgersByIndex.find(index); @@ -525,6 +537,10 @@ LedgerHistory::validatedLedger( bool LedgerHistory::fixIndex(LedgerIndex ledgerIndex, LedgerHash const& ledgerHash) { + static unsigned long call_count{0}; + JLOG(j_.debug()) << "LedgerHistory lock stats," + << ", fixIndex, call_count = " << call_count++; + auto ledger = m_ledgers_by_hash.fetch(ledgerHash); auto it = mLedgersByIndex.find(ledgerIndex); if (ledger && (it != mLedgersByIndex.end()) && (it->second != ledgerHash))