diff --git a/handlers/LedgerData.cpp b/handlers/LedgerData.cpp index b134b54a..30352a17 100644 --- a/handlers/LedgerData.cpp +++ b/handlers/LedgerData.cpp @@ -47,6 +47,12 @@ doLedgerData( response["error"] = "Empty database"; return response; } + auto ledger = backend.fetchLedgerBySequence(*ledgerSequence); + if (!ledger) + { + response["error"] = "Ledger not found"; + return response; + } std::optional cursor; if (request.contains("cursor")) diff --git a/reporting/ReportingETL.cpp b/reporting/ReportingETL.cpp index 0c45821c..6def1213 100644 --- a/reporting/ReportingETL.cpp +++ b/reporting/ReportingETL.cpp @@ -645,5 +645,7 @@ ReportingETL::ReportingETL( flatMapBackend_->open(); if (config.contains("start_sequence")) startSequence_ = config.at("start_sequence").as_int64(); + if (config.contains("read_only")) + readOnly_ = config.at("read_only").as_bool(); }