aboutsummaryrefslogtreecommitdiff
path: root/src/txdb.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/txdb.h
parent89eddcd365e9a2218648f5cc5b9f22b28023f50a (diff)
downloadbitcoin-ec3073a274bf7affe1b8c87a10f75d126f5ac027.tar.xz
index: Move index DBs into index/ directory.
Diffstat (limited to 'src/txdb.h')
-rw-r--r--src/txdb.h64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/txdb.h b/src/txdb.h
index f9d9e4246c..100adb428d 100644
--- a/src/txdb.h
+++ b/src/txdb.h
@@ -40,31 +40,6 @@ static const int64_t nMaxTxIndexCache = 1024;
//! Max memory allocated to coin DB specific cache (MiB)
static const int64_t nMaxCoinsDBCache = 8;
-struct CDiskTxPos : public CDiskBlockPos
-{
- unsigned int nTxOffset; // after header
-
- ADD_SERIALIZE_METHODS;
-
- template <typename Stream, typename Operation>
- inline void SerializationOp(Stream& s, Operation ser_action) {
- READWRITEAS(CDiskBlockPos, *this);
- READWRITE(VARINT(nTxOffset));
- }
-
- CDiskTxPos(const CDiskBlockPos &blockIn, unsigned int nTxOffsetIn) : CDiskBlockPos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) {
- }
-
- CDiskTxPos() {
- SetNull();
- }
-
- void SetNull() {
- CDiskBlockPos::SetNull();
- nTxOffset = 0;
- }
-};
-
/** CCoinsView backed by the coin database (chainstate/) */
class CCoinsViewDB final : public CCoinsView
{
@@ -123,43 +98,4 @@ public:
bool LoadBlockIndexGuts(const Consensus::Params& consensusParams, std::function<CBlockIndex*(const uint256&)> insertBlockIndex);
};
-class BaseIndexDB : public CDBWrapper
-{
-public:
- BaseIndexDB(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 index is in sync with.
- bool ReadBestBlock(CBlockLocator& locator) const;
-
- /// Write block locator of the chain that the index is in sync with.
- bool WriteBestBlock(const CBlockLocator& locator);
-};
-
-/**
- * Access to the txindex database (indexes/txindex/)
- *
- * The database stores a block locator of the chain the database is synced to
- * so that the TxIndex can efficiently determine the point it last stopped at.
- * A locator is used instead of a simple hash of the chain tip because blocks
- * and block index entries may not be flushed to disk until after this database
- * is updated.
- */
-class TxIndexDB : public BaseIndexDB
-{
-public:
- explicit TxIndexDB(size_t n_cache_size, bool f_memory = false, bool f_wipe = false);
-
- /// Read the disk location of the transaction data with the given hash. Returns false if the
- /// transaction hash is not indexed.
- bool ReadTxPos(const uint256& txid, CDiskTxPos& pos) const;
-
- /// Write a batch of transaction positions to the DB.
- bool WriteTxs(const std::vector<std::pair<uint256, CDiskTxPos>>& v_pos);
-
- /// Migrate txindex data from the block tree DB, where it may be for older nodes that have not
- /// been upgraded yet to the new database.
- bool MigrateData(CBlockTreeDB& block_tree_db, const CBlockLocator& best_locator);
-};
-
#endif // BITCOIN_TXDB_H