mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-15 01:58:09 +02:00
index: Move index DBs into index/ directory.
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
#include <validation.h>
|
||||
#include <warnings.h>
|
||||
|
||||
constexpr char DB_BEST_BLOCK = 'B';
|
||||
|
||||
constexpr int64_t SYNC_LOG_INTERVAL = 30; // seconds
|
||||
constexpr int64_t SYNC_LOCATOR_WRITE_INTERVAL = 30; // seconds
|
||||
|
||||
@@ -26,6 +28,24 @@ static void FatalError(const char* fmt, const Args&... args)
|
||||
StartShutdown();
|
||||
}
|
||||
|
||||
BaseIndex::DB::DB(const fs::path& path, size_t n_cache_size, bool f_memory, bool f_wipe, bool f_obfuscate) :
|
||||
CDBWrapper(path, n_cache_size, f_memory, f_wipe, f_obfuscate)
|
||||
{}
|
||||
|
||||
bool BaseIndex::DB::ReadBestBlock(CBlockLocator& locator) const
|
||||
{
|
||||
bool success = Read(DB_BEST_BLOCK, locator);
|
||||
if (!success) {
|
||||
locator.SetNull();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
bool BaseIndex::DB::WriteBestBlock(const CBlockLocator& locator)
|
||||
{
|
||||
return Write(DB_BEST_BLOCK, locator);
|
||||
}
|
||||
|
||||
BaseIndex::~BaseIndex()
|
||||
{
|
||||
Interrupt();
|
||||
|
||||
Reference in New Issue
Block a user