mirror of
https://github.com/XRPLF/clio.git
synced 2026-06-06 18:26:47 +00:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user