fix: Start without cache file (#2976)

#2830 introduced a bug that clio couldn't start without having a cache
file. This PR fixes the problem.
This commit is contained in:
Sergey Kuznetsov
2026-03-06 15:59:27 +00:00
committed by GitHub
parent 3737459d09
commit 05e52ee7a4
20 changed files with 435 additions and 201 deletions

View File

@@ -19,6 +19,7 @@
#include "etl/WriterState.hpp"
#include "data/LedgerCacheInterface.hpp"
#include "etl/SystemState.hpp"
#include <memory>
@@ -26,7 +27,11 @@
namespace etl {
WriterState::WriterState(std::shared_ptr<SystemState> state) : systemState_(std::move(state))
WriterState::WriterState(
std::shared_ptr<SystemState> state,
data::LedgerCacheInterface const& cache
)
: systemState_(std::move(state)), cache_(cache)
{
}
@@ -73,9 +78,15 @@ WriterState::isFallback() const
}
bool
WriterState::isLoadingCache() const
WriterState::isEtlStarted() const
{
return systemState_->isLoadingCache;
return systemState_->etlStarted;
}
bool
WriterState::isCacheFull() const
{
return cache_.get().isFull();
}
std::unique_ptr<WriterStateInterface>