boost::optional< uint256 > validatedConsensusHash
bool fixIndex(LedgerIndex ledgerIndex, LedgerHash const &ledgerHash)
Repair a hash to index mapping.
std::map< LedgerIndex, LedgerHash > mLedgersByIndex
void tune(int size, std::chrono::seconds age)
Set the history cache's parameters.
boost::optional< LedgerHash > validated
Retains historical ledgers.
void sweep()
Remove stale cache entries.
LedgerHash getLedgerHash(LedgerIndex ledgerIndex)
Get a ledger's hash given its sequence number.
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
bool insert(std::shared_ptr< Ledger const > ledger, bool validated)
Track a ledger.
std::shared_ptr< Ledger const > getLedgerByHash(LedgerHash const &ledgerHash)
Retrieve a ledger given its hash.
beast::insight::Collector::ptr collector_
void handleMismatch(LedgerHash const &built, LedgerHash const &valid, boost::optional< uint256 > const &builtConsensusHash, boost::optional< uint256 > const &validatedConsensusHash, Json::Value const &consensus)
Log details in the case where we build one ledger but validate a different one.
void validatedLedger(std::shared_ptr< Ledger const > const &, boost::optional< uint256 > const &consensusHash)
Report that we have validated a particular ledger.
std::shared_ptr< Ledger const > getLedgerBySeq(LedgerIndex ledgerIndex)
Get a ledger given its sequence number.
boost::optional< LedgerHash > built
boost::optional< uint256 > builtConsensusHash
boost::optional< Json::Value > consensus
float getCacheHitRate()
Get the ledgers_by_hash cache hit rate.
void clearLedgerCachePrior(LedgerIndex seq)
beast::insight::Counter mismatch_counter_
LedgerHistory(beast::insight::Collector::ptr const &collector, Application &app)
LedgersByHash m_ledgers_by_hash