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_)
{
flatMapBackend_.sync();
writeToPostgres(lgrInfo, accountTxData, pgPool_);
for (auto& data : accountTxData)
{
flatMapBackend_.storeAccountTx(std::move(data));
}
bool success = flatMapBackend_.writeLedger(
lgrInfo, std::move(*ledgerData->mutable_ledger_header()));
}
auto end = std::chrono::system_clock::now();
BOOST_LOG_TRIVIAL(debug) << "Time to download and store ledger = "