From ec3073a274bf7affe1b8c87a10f75d126f5ac027 Mon Sep 17 00:00:00 2001 From: Jim Posen Date: Tue, 15 May 2018 17:20:17 -0700 Subject: index: Move index DBs into index/ directory. --- src/index/base.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/index/base.h') diff --git a/src/index/base.h b/src/index/base.h index 68efaaaf26..04ee6e6cc2 100644 --- a/src/index/base.h +++ b/src/index/base.h @@ -5,10 +5,10 @@ #ifndef BITCOIN_INDEX_BASE_H #define BITCOIN_INDEX_BASE_H +#include #include #include #include -#include #include #include @@ -21,6 +21,20 @@ class CBlockIndex; */ class BaseIndex : public CValidationInterface { +protected: + class DB : public CDBWrapper + { + public: + DB(const fs::path& path, size_t n_cache_size, + bool f_memory = false, bool f_wipe = false, bool f_obfuscate = false); + + /// Read block locator of the chain that the txindex is in sync with. + bool ReadBestBlock(CBlockLocator& locator) const; + + /// Write block locator of the chain that the txindex is in sync with. + bool WriteBestBlock(const CBlockLocator& locator); + }; + private: /// Whether the index is in sync with the main chain. The flag is flipped /// from false to true once, after which point this starts processing @@ -55,7 +69,7 @@ protected: /// Write update index entries for a newly connected block. virtual bool WriteBlock(const CBlock& block, const CBlockIndex* pindex) { return true; } - virtual BaseIndexDB& GetDB() const = 0; + virtual DB& GetDB() const = 0; /// Get the name of the index for display in logs. virtual const char* GetName() const = 0; -- cgit v1.2.3