fix initial ledger load

This commit is contained in:
CJ Cobb
2021-02-11 17:09:37 -05:00
parent bb1205fd36
commit 069fd1a259

View File

@@ -126,8 +126,12 @@ ReportingETL::loadInitialLedger(uint32_t startingSequence)
if (!stopping_) if (!stopping_)
{ {
flatMapBackend_.sync(); for (auto& data : accountTxData)
writeToPostgres(lgrInfo, accountTxData, pgPool_); {
flatMapBackend_.storeAccountTx(std::move(data));
}
bool success = flatMapBackend_.writeLedger(
lgrInfo, std::move(*ledgerData->mutable_ledger_header()));
} }
auto end = std::chrono::system_clock::now(); auto end = std::chrono::system_clock::now();
BOOST_LOG_TRIVIAL(debug) << "Time to download and store ledger = " BOOST_LOG_TRIVIAL(debug) << "Time to download and store ledger = "