aboutsummaryrefslogtreecommitdiff
path: root/src/index/base.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/index/base.h')
-rw-r--r--src/index/base.h18
1 files changed, 16 insertions, 2 deletions
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 <dbwrapper.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <threadinterrupt.h>
-#include <txdb.h>
#include <uint256.h>
#include <validationinterface.h>
@@ -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;