Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

Access to the block database (blocks/index/) More...

#include <txdb.h>

+ Inheritance diagram for CBlockTreeDB:
+ Collaboration diagram for CBlockTreeDB:

Public Member Functions

 CBlockTreeDB (size_t nCacheSize, bool fMemory=false, bool fWipe=false)
 
 CBlockTreeDB (const CBlockTreeDB &)=delete
 
CBlockTreeDBoperator= (const CBlockTreeDB &)=delete
 
bool WriteBatchSync (const std::vector< std::pair< int, const CBlockFileInfo *> > &fileInfo, int nLastFile, const std::vector< const CBlockIndex *> &blockinfo)
 
bool ReadBlockFileInfo (int nFile, CBlockFileInfo &info)
 
bool ReadLastBlockFile (int &nFile)
 
bool WriteReindexing (bool fReindexing)
 
bool ReadReindexing (bool &fReindexing)
 
bool HasTxIndex (const uint256 &txid)
 
bool ReadTxIndex (const uint256 &txid, CDiskTxPos &pos)
 
bool WriteTxIndex (const std::vector< std::pair< uint256, CDiskTxPos > > &vect)
 
bool ReadSpentIndex (CSpentIndexKey &key, CSpentIndexValue &value)
 
bool UpdateSpentIndex (const std::vector< std::pair< CSpentIndexKey, CSpentIndexValue > > &vect)
 
bool UpdateAddressUnspentIndex (const std::vector< std::pair< CAddressUnspentKey, CAddressUnspentValue > > &vect)
 
bool ReadAddressUnspentIndex (uint160 addressHash, int type, std::vector< std::pair< CAddressUnspentKey, CAddressUnspentValue > > &vect)
 
bool WriteAddressIndex (const std::vector< std::pair< CAddressIndexKey, CAmount > > &vect)
 
bool EraseAddressIndex (const std::vector< std::pair< CAddressIndexKey, CAmount > > &vect)
 
bool ReadAddressIndex (uint160 addressHash, int type, std::vector< std::pair< CAddressIndexKey, CAmount > > &addressIndex, int start=0, int end=0)
 
bool WriteTimestampIndex (const CTimestampIndexKey &timestampIndex)
 
bool ReadTimestampIndex (const unsigned int &high, const unsigned int &low, std::vector< uint256 > &vect)
 
bool WriteFlag (const std::string &name, bool fValue)
 
bool ReadFlag (const std::string &name, bool &fValue)
 
bool LoadBlockIndexGuts (const Consensus::Params &consensusParams, std::function< CBlockIndex *(const uint256 &)> insertBlockIndex)
 
- Public Member Functions inherited from CDBWrapper
 CDBWrapper (const fs::path &path, size_t nCacheSize, bool fMemory=false, bool fWipe=false, bool obfuscate=false)
 
 ~CDBWrapper ()
 
template<typename K >
bool ReadDataStream (const K &key, CDataStream &ssValue) const
 
bool ReadDataStream (const CDataStream &ssKey, CDataStream &ssValue) const
 
template<typename K , typename V >
bool Read (const K &key, V &value) const
 
template<typename V >
bool Read (const CDataStream &ssKey, V &value) const
 
template<typename K , typename V >
bool Write (const K &key, const V &value, bool fSync=false)
 
template<typename K >
bool Exists (const K &key) const
 
bool Exists (const CDataStream &key) const
 
template<typename K >
bool Erase (const K &key, bool fSync=false)
 
bool WriteBatch (CDBBatch &batch, bool fSync=false)
 
bool Flush ()
 
bool Sync ()
 
CDBIteratorNewIterator ()
 
bool IsEmpty ()
 Return true if the database managed by this class contains no entries. More...
 
template<typename K >
size_t EstimateSize (const K &key_begin, const K &key_end) const
 
template<typename K >
void CompactRange (const K &key_begin, const K &key_end) const
 Compact a certain range of keys in the database. More...
 
void CompactFull () const
 

Private Attributes

CCriticalSection cs
 
unordered_limitedmap< uint256, bool > mapHasTxIndexCache
 

Detailed Description

Access to the block database (blocks/index/)

Definition at line 114 of file txdb.h.

Constructor & Destructor Documentation

◆ CBlockTreeDB() [1/2]

CBlockTreeDB::CBlockTreeDB ( size_t  nCacheSize,
bool  fMemory = false,
bool  fWipe = false 
)
explicit

Definition at line 154 of file txdb.cpp.

◆ CBlockTreeDB() [2/2]

CBlockTreeDB::CBlockTreeDB ( const CBlockTreeDB )
delete

Member Function Documentation

◆ EraseAddressIndex()

bool CBlockTreeDB::EraseAddressIndex ( const std::vector< std::pair< CAddressIndexKey, CAmount > > &  vect)

Definition at line 337 of file txdb.cpp.

References DB_ADDRESSINDEX, CDBBatch::Erase(), and CDBWrapper::WriteBatch().

◆ HasTxIndex()

◆ LoadBlockIndexGuts()

◆ operator=()

CBlockTreeDB& CBlockTreeDB::operator= ( const CBlockTreeDB )
delete

◆ ReadAddressIndex()

bool CBlockTreeDB::ReadAddressIndex ( uint160  addressHash,
int  type,
std::vector< std::pair< CAddressIndexKey, CAmount > > &  addressIndex,
int  start = 0,
int  end = 0 
)

Definition at line 344 of file txdb.cpp.

References DB_ADDRESSINDEX, error(), and CDBWrapper::NewIterator().

◆ ReadAddressUnspentIndex()

bool CBlockTreeDB::ReadAddressUnspentIndex ( uint160  addressHash,
int  type,
std::vector< std::pair< CAddressUnspentKey, CAddressUnspentValue > > &  vect 
)

Definition at line 304 of file txdb.cpp.

References DB_ADDRESSUNSPENTINDEX, error(), and CDBWrapper::NewIterator().

◆ ReadBlockFileInfo()

bool CBlockTreeDB::ReadBlockFileInfo ( int  nFile,
CBlockFileInfo info 
)

Definition at line 157 of file txdb.cpp.

References DB_BLOCK_FILES, and CDBWrapper::Read().

◆ ReadFlag()

bool CBlockTreeDB::ReadFlag ( const std::string &  name,
bool &  fValue 
)

Definition at line 408 of file txdb.cpp.

References DB_FLAG, name, and CDBWrapper::Read().

◆ ReadLastBlockFile()

bool CBlockTreeDB::ReadLastBlockFile ( int &  nFile)

Definition at line 173 of file txdb.cpp.

References DB_LAST_BLOCK, and CDBWrapper::Read().

◆ ReadReindexing()

bool CBlockTreeDB::ReadReindexing ( bool &  fReindexing)

Definition at line 168 of file txdb.cpp.

References DB_REINDEX_FLAG, and CDBWrapper::Exists().

◆ ReadSpentIndex()

bool CBlockTreeDB::ReadSpentIndex ( CSpentIndexKey key,
CSpentIndexValue value 
)

Definition at line 276 of file txdb.cpp.

References DB_SPENTINDEX, and CDBWrapper::Read().

◆ ReadTimestampIndex()

bool CBlockTreeDB::ReadTimestampIndex ( const unsigned int &  high,
const unsigned int &  low,
std::vector< uint256 > &  vect 
)

Definition at line 384 of file txdb.cpp.

References DB_TIMESTAMPINDEX, high, low, and CDBWrapper::NewIterator().

◆ ReadTxIndex()

bool CBlockTreeDB::ReadTxIndex ( const uint256 txid,
CDiskTxPos pos 
)

◆ UpdateAddressUnspentIndex()

bool CBlockTreeDB::UpdateAddressUnspentIndex ( const std::vector< std::pair< CAddressUnspentKey, CAddressUnspentValue > > &  vect)

◆ UpdateSpentIndex()

bool CBlockTreeDB::UpdateSpentIndex ( const std::vector< std::pair< CSpentIndexKey, CSpentIndexValue > > &  vect)

◆ WriteAddressIndex()

bool CBlockTreeDB::WriteAddressIndex ( const std::vector< std::pair< CAddressIndexKey, CAmount > > &  vect)

Definition at line 330 of file txdb.cpp.

References DB_ADDRESSINDEX, CDBBatch::Write(), and CDBWrapper::WriteBatch().

◆ WriteBatchSync()

bool CBlockTreeDB::WriteBatchSync ( const std::vector< std::pair< int, const CBlockFileInfo *> > &  fileInfo,
int  nLastFile,
const std::vector< const CBlockIndex *> &  blockinfo 
)

◆ WriteFlag()

bool CBlockTreeDB::WriteFlag ( const std::string &  name,
bool  fValue 
)

Definition at line 404 of file txdb.cpp.

References DB_FLAG, name, and CDBWrapper::Write().

◆ WriteReindexing()

bool CBlockTreeDB::WriteReindexing ( bool  fReindexing)

Definition at line 161 of file txdb.cpp.

References DB_REINDEX_FLAG, CDBWrapper::Erase(), and CDBWrapper::Write().

◆ WriteTimestampIndex()

bool CBlockTreeDB::WriteTimestampIndex ( const CTimestampIndexKey timestampIndex)

Definition at line 378 of file txdb.cpp.

References DB_TIMESTAMPINDEX, CDBBatch::Write(), and CDBWrapper::WriteBatch().

◆ WriteTxIndex()

bool CBlockTreeDB::WriteTxIndex ( const std::vector< std::pair< uint256, CDiskTxPos > > &  vect)

Member Data Documentation

◆ cs

CCriticalSection CBlockTreeDB::cs
private

Definition at line 117 of file txdb.h.

Referenced by HasTxIndex(), ReadTxIndex(), and WriteTxIndex().

◆ mapHasTxIndexCache

unordered_limitedmap<uint256, bool> CBlockTreeDB::mapHasTxIndexCache
private

Definition at line 118 of file txdb.h.

Referenced by HasTxIndex(), ReadTxIndex(), and WriteTxIndex().


The documentation for this class was generated from the following files:
Released under the MIT license