From 8174b942c3797ad272dbcff6ecb668274b373d1d Mon Sep 17 00:00:00 2001 From: Valentin Balaschenko <13349202+vlntb@users.noreply.github.com> Date: Mon, 6 Jul 2026 19:13:28 +0100 Subject: [PATCH] fixing clang-tidy and auto formating --- src/xrpld/app/ledger/LedgerHistory.cpp | 13 +++++++------ src/xrpld/app/ledger/LedgerHistory.h | 7 ++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/xrpld/app/ledger/LedgerHistory.cpp b/src/xrpld/app/ledger/LedgerHistory.cpp index b29d49313b..a7adec8f4f 100644 --- a/src/xrpld/app/ledger/LedgerHistory.cpp +++ b/src/xrpld/app/ledger/LedgerHistory.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,7 @@ LedgerHistory::LedgerHistory(beast::insight::Collector::ptr const& collector, Ap : app_(app) , collector_(collector) , mismatchCounter_(collector->makeCounter("ledger.history", "mismatch")) - , mConsensusValidated_( + , consensusValidated_( "ConsensusValidated", 64, std::chrono::minutes{5}, @@ -197,7 +198,7 @@ logMetadataDifference( auto builtMetaData = getMeta(builtLedger, tx); XRPL_ASSERT( - validMetaData || builtMetaData, "xrpl::log_metadata_difference : some metadata present"); + validMetaData || builtMetaData, "xrpl::logMetadataDifference : some metadata present"); if (validMetaData && builtMetaData) { @@ -274,7 +275,7 @@ logMetadataDifference( << " Index: " << validMetaData->getIndex() << " Nodes:\n" << validNodes.getJson(JsonOptions::Values::None); } - else // nodes_diff + else // nodesDiff { JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different nodes!"; JLOG(j.debug()) << " Built:" @@ -444,7 +445,7 @@ LedgerHistory::builtLedger( }; std::optional mismatch; - mConsensusValidated_.fetchAndModify(index, [&](CvEntry& entry) { + consensusValidated_.fetchAndModify(index, [&](CvEntry& entry) { if (entry.validated && !entry.built) { if (entry.validated.value() != hash) @@ -496,7 +497,7 @@ LedgerHistory::validatedLedger( }; std::optional mismatch; - mConsensusValidated_.fetchAndModify(index, [&](CvEntry& entry) { + consensusValidated_.fetchAndModify(index, [&](CvEntry& entry) { if (entry.built && !entry.validated) { if (entry.built.value() != hash) @@ -530,7 +531,7 @@ LedgerHistory::validatedLedger( } } -/** Ensure m_ledgers_by_hash doesn't have the wrong hash for a particular index +/** Ensure byHash doesn't have the wrong hash for a particular index */ bool LedgerHistory::fixIndex(LedgerIndex ledgerIndex, LedgerHash const& ledgerHash) diff --git a/src/xrpld/app/ledger/LedgerHistory.h b/src/xrpld/app/ledger/LedgerHistory.h index 648c620614..80b89c395e 100644 --- a/src/xrpld/app/ledger/LedgerHistory.h +++ b/src/xrpld/app/ledger/LedgerHistory.h @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -33,7 +34,7 @@ public: bool insert(std::shared_ptr const& ledger, bool validated); - /** Get the ledgers_by_hash cache hit rate + /** Get the byHash cache hit rate @return the hit rate */ float @@ -67,7 +68,7 @@ public: auto lock = ledgerMaps_.lock(); lock->byHash->sweep(); } - mConsensusValidated_.sweep(); + consensusValidated_.sweep(); } /** Report that we have locally built a particular ledger */ @@ -140,7 +141,7 @@ private: std::optional consensus; }; using ConsensusValidated = TaggedCache; - ConsensusValidated mConsensusValidated_; + ConsensusValidated consensusValidated_; beast::Journal j_; };