aboutsummaryrefslogtreecommitdiff
path: root/src/index/base.h
diff options
context:
space:
mode:
authorJim Posen <jim.posen@gmail.com>2018-05-15 17:20:17 -0700
committerJim Posen <jim.posen@gmail.com>2018-06-04 19:22:30 -0700
commitec3073a274bf7affe1b8c87a10f75d126f5ac027 (patch)
tree9f56192c49d79d2c23a5618b8b663926bc1b9fb2 /src/index/base.h
parent89eddcd365e9a2218648f5cc5b9f22b28023f50a (diff)
downloadbitcoin-ec3073a274bf7affe1b8c87a10f75d126f5ac027.tar.xz
index: Move index DBs into index/ directory.
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;