refactor: Add Chainstate::StoragePath() method

Use to simplify code determining the chainstate leveldb paths. New method is
the now the only code that needs to figure out the storage path, so the path
doesn't need to be constructed multiple places and backed out of leveldb.
This commit is contained in:
Ryan Ofsky
2024-05-30 11:25:04 -04:00
parent 840bd2ef23
commit a9b7f5614c
8 changed files with 45 additions and 89 deletions

View File

@@ -214,7 +214,7 @@ struct LevelDBContext {
};
CDBWrapper::CDBWrapper(const DBParams& params)
: m_db_context{std::make_unique<LevelDBContext>()}, m_name{fs::PathToString(params.path.stem())}, m_path{params.path}, m_is_memory{params.memory_only}
: m_db_context{std::make_unique<LevelDBContext>()}, m_name{fs::PathToString(params.path.stem())}
{
DBContext().penv = nullptr;
DBContext().readoptions.verify_checksums = true;