From fc04336caaee32e57fef81d72c82f1f596fef694 Mon Sep 17 00:00:00 2001 From: Mark Travis Date: Thu, 2 Dec 2021 17:57:54 -0800 Subject: [PATCH] Reporting mode always returns age in server_info. --- src/ripple/app/misc/NetworkOPs.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index 4abaf22c6..e87bec56e 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -2574,6 +2574,11 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters) if (std::abs(closeOffset.count()) >= 60) l[jss::close_time_offset] = closeOffset.count(); +#if RIPPLED_REPORTING + std::int64_t const dbAge = + std::max(m_ledgerMaster.getValidatedLedgerAge().count(), 0L); + l[jss::age] = Json::UInt(dbAge); +#else constexpr std::chrono::seconds highAgeThreshold{1000000}; if (m_ledgerMaster.haveValidated()) { @@ -2593,6 +2598,7 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters) Json::UInt(age < highAgeThreshold ? age.count() : 0); } } +#endif } if (valid)