From b21958c438b8bc90231aea0b5eecf49ba5ccf450 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Fri, 25 Sep 2026 13:13:26 +0100 Subject: [PATCH] docs: Fix three LedgerMaster comment inaccuracies The class comment called the closed ledger "not yet fully validated" and said the published ledger "lags" the validated one. Both can equal the validated ledger: standalone switchLCL() validates the closed ledger at once, and doAdvance() publishes up to and including the validated sequence. The ValSeq comment said the first sequence seen is kept. The code replaces a zero, so it keeps the first nonzero sequence. Also drop the trailing comment on newOrderBookDB(), which repeated its @return. --- src/xrpld/app/ledger/LedgerMaster.h | 6 +++--- src/xrpld/app/ledger/detail/LedgerMaster.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xrpld/app/ledger/LedgerMaster.h b/src/xrpld/app/ledger/LedgerMaster.h index 27bd2cdb9e..ff12e8a314 100644 --- a/src/xrpld/app/ledger/LedgerMaster.h +++ b/src/xrpld/app/ledger/LedgerMaster.h @@ -50,9 +50,9 @@ class Transaction; * Four ledgers are tracked, and they can all differ: * * current open ledger new transactions go into (owned by OpenLedger) - * closed most recently closed ledger, not yet fully validated + * closed most recently closed ledger; may already be validated * validated highest ledger with a quorum of trusted validations - * published highest ledger handed to subscribed clients; lags validated + * published highest ledger handed to subscribed clients; can lag validated * * RCLConsensus ──switchLCL/consensusBuilt──> LedgerMaster * PeerImp ──────gotFetchPack/makeFetchPack─> │ @@ -577,7 +577,7 @@ public: * @return true if able to fulfill request. */ bool - newOrderBookDB(); // Returns true if able to fulfill request. + newOrderBookDB(); /** * Corrects the cached sequence-to-hash mapping for one ledger. diff --git a/src/xrpld/app/ledger/detail/LedgerMaster.cpp b/src/xrpld/app/ledger/detail/LedgerMaster.cpp index 06e1b0af57..d38a2ad110 100644 --- a/src/xrpld/app/ledger/detail/LedgerMaster.cpp +++ b/src/xrpld/app/ledger/detail/LedgerMaster.cpp @@ -1153,7 +1153,7 @@ LedgerMaster::consensusBuilt( * * One tally per ledger hash, built while scanning the current trusted * validations. A validation names a hash but not always a usable sequence, - * so the first sequence seen for a hash is kept and later ones ignored. + * so the first nonzero sequence seen for a hash is kept. * * @note Not thread-safe, and not intended to be: instances live only inside * the loop below, which holds no lock.