void validatedLedger(std::shared_ptr< Ledger const > const &, std::optional< uint256 > const &consensusHash)
Report that we have validated a particular ledger.
ConsensusValidated consensusValidated_
beast::insight::Collector::ptr collector_
bool insert(std::shared_ptr< Ledger const > const &ledger, bool validated)
Track a ledger.
float getCacheHitRate()
Get the ledgers_by_hash cache hit rate.
LedgerHash getLedgerHash(LedgerIndex ledgerIndex)
Get a ledger's hash given its sequence number.
bool fixIndex(LedgerIndex ledgerIndex, LedgerHash const &ledgerHash)
Repair a hash to index mapping.
std::shared_ptr< Ledger const > getLedgerByHash(LedgerHash const &ledgerHash)
Retrieve a ledger given its hash.
void builtLedger(std::shared_ptr< Ledger const > const &, uint256 const &consensusHash, json::Value)
Report that we have locally built a particular ledger.
LedgerHistory(beast::insight::Collector::ptr const &collector, Application &app)
void sweep()
Remove stale cache entries.
void handleMismatch(LedgerHash const &built, LedgerHash const &valid, std::optional< uint256 > const &builtConsensusHash, std::optional< uint256 > const &validatedConsensusHash, json::Value const &consensus)
Log details in the case where we build one ledger but validate a different one.
beast::insight::Counter mismatchCounter_
std::shared_ptr< Ledger const > getLedgerBySeq(LedgerIndex ledgerIndex)
Get a ledger given its sequence number.
LedgersByHash ledgersByHash_
void clearLedgerCachePrior(LedgerIndex seq)
std::map< LedgerIndex, LedgerHash > ledgersByIndex_
TaggedCache< LedgerIndex, CvEntry > ConsensusValidated
TaggedCache< LedgerHash, Ledger const > LedgersByHash
std::optional< uint256 > builtConsensusHash
std::optional< LedgerHash > validated
std::optional< uint256 > validatedConsensusHash
std::optional< LedgerHash > built
std::optional< json::Value > consensus