mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 07:25:51 +00:00
debug traces
This commit is contained in:
@@ -139,7 +139,7 @@ public:
|
||||
|
||||
private:
|
||||
std::unordered_map<Key, Mapped> data_;
|
||||
std::queue<Key> order_; // assumes non-decreasing inserts for O(k) purge
|
||||
std::queue<Key> order_;
|
||||
mutable std::mutex mutex_;
|
||||
};
|
||||
|
||||
|
||||
@@ -533,18 +533,24 @@ LedgerHistory::fixIndex(LedgerIndex ledgerIndex, LedgerHash const& ledgerHash)
|
||||
void
|
||||
LedgerHistory::clearLedgerCachePrior(LedgerIndex seq)
|
||||
{
|
||||
std::size_t hashesCleared = 0;
|
||||
for (LedgerHash it : m_ledgers_by_hash.getKeys())
|
||||
{
|
||||
auto const ledger = getLedgerByHash(it);
|
||||
if (!ledger || ledger->info().seq < seq)
|
||||
{
|
||||
m_ledgers_by_hash.del(it, false);
|
||||
++hashesCleared;
|
||||
}
|
||||
}
|
||||
JLOG(j_.debug()) << "LedgersByHash: cleared " << hashesCleared
|
||||
<< " entries before seq " << seq << " (total now "
|
||||
<< m_ledgers_by_hash.size() << ")";
|
||||
|
||||
JLOG(j_.debug()) << "mLedgersByIndex size before clear: "
|
||||
<< mLedgersByIndex.size();
|
||||
mLedgersByIndex.eraseBefore(seq);
|
||||
JLOG(j_.debug()) << "mLedgersByIndex size after clear: "
|
||||
<< mLedgersByIndex.size();
|
||||
std::size_t const indexesCleared = mLedgersByIndex.eraseBefore(seq);
|
||||
JLOG(j_.debug()) << "LedgerIndexMap: cleared " << indexesCleared
|
||||
<< " index entries before seq " << seq << " (total now "
|
||||
<< mLedgersByIndex.size() << ")";
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
Reference in New Issue
Block a user