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.
bool fixIndex(LedgerIndex ledgerIndex, LedgerHash const &ledgerHash)
Repair a hash to index mapping.
std::map< LedgerIndex, LedgerHash > mLedgersByIndex
Retains historical ledgers.
void sweep()
Remove stale cache entries.
LedgerHash getLedgerHash(LedgerIndex ledgerIndex)
Get a ledger's hash given its sequence number.
bool insert(std::shared_ptr< Ledger const > const &ledger, bool validated)
Track a ledger.
void builtLedger(std::shared_ptr< Ledger const > const &, uint256 const &consensusHash, Json::Value)
Report that we have locally built a particular ledger.
ConsensusValidated m_consensus_validated
std::optional< Json::Value > consensus
std::shared_ptr< Ledger const > getLedgerByHash(LedgerHash const &ledgerHash)
Retrieve a ledger given its hash.
std::optional< LedgerHash > validated
beast::insight::Collector::ptr collector_
void validatedLedger(std::shared_ptr< Ledger const > const &, std::optional< uint256 > const &consensusHash)
Report that we have validated a particular ledger.
std::optional< LedgerHash > built
std::shared_ptr< Ledger const > getLedgerBySeq(LedgerIndex ledgerIndex)
Get a ledger given its sequence number.
std::optional< uint256 > validatedConsensusHash
float getCacheHitRate()
Get the ledgers_by_hash cache hit rate.
void clearLedgerCachePrior(LedgerIndex seq)
std::optional< uint256 > builtConsensusHash
beast::insight::Counter mismatch_counter_
LedgerHistory(beast::insight::Collector::ptr const &collector, Application &app)
LedgersByHash m_ledgers_by_hash