From 83a099a547eec279b0f4470ddd1c4bb9cf40cef2 Mon Sep 17 00:00:00 2001 From: CJ Cobb <46455409+cjcobb23@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:17:42 -0400 Subject: [PATCH] Fix bug where some ledgers are not being published (#281) * The ledger close time can occasionally be a few seconds in the future, which causes ETL to not publish the ledger, because the age calculation wraps around and the age is computed as a very large unsigned integer. This fix rounds to zero when the age would be negative --- src/etl/ReportingETL.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/etl/ReportingETL.h b/src/etl/ReportingETL.h index ebc408454..71d32991a 100644 --- a/src/etl/ReportingETL.h +++ b/src/etl/ReportingETL.h @@ -382,6 +382,8 @@ public: std::chrono::system_clock::now().time_since_epoch()) .count(); auto closeTime = lastCloseTime_.time_since_epoch().count(); + if (now < (rippleEpochStart + closeTime)) + return 0; return now - (rippleEpochStart + closeTime); } };