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>
Public Member Functions | |
CBlockTreeDB (size_t nCacheSize, bool fMemory=false, bool fWipe=false) | |
CBlockTreeDB (const CBlockTreeDB &)=delete | |
CBlockTreeDB & | operator= (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 ×tampIndex) |
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 () |
CDBIterator * | NewIterator () |
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
Constructor & Destructor Documentation
◆ CBlockTreeDB() [1/2]
◆ CBlockTreeDB() [2/2]
|
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()
bool CBlockTreeDB::HasTxIndex | ( | const uint256 & | txid | ) |
Definition at line 243 of file txdb.cpp.
References cs, DB_TXINDEX, unordered_limitedmap< K, V, Hash >::end(), CDBWrapper::Exists(), unordered_limitedmap< K, V, Hash >::find(), unordered_limitedmap< K, V, Hash >::insert(), LOCK, and mapHasTxIndexCache.
◆ LoadBlockIndexGuts()
bool CBlockTreeDB::LoadBlockIndexGuts | ( | const Consensus::Params & | consensusParams, |
std::function< CBlockIndex *(const uint256 &)> | insertBlockIndex | ||
) |
Definition at line 416 of file txdb.cpp.
References CheckProofOfWork(), DB_BLOCK_INDEX, error(), CBlockIndex::GetBlockHash(), CDiskBlockIndex::GetBlockHash(), CBlockIndex::hashMerkleRoot, CDiskBlockIndex::hashPrev, CBlockIndex::nBits, CBlockIndex::nDataPos, CDBWrapper::NewIterator(), CBlockIndex::nFile, CBlockIndex::nHeight, CBlockIndex::nNonce, CBlockIndex::nStatus, CBlockIndex::nTime, CBlockIndex::nTx, CBlockIndex::nUndoPos, CBlockIndex::nVersion, CBlockIndex::pprev, and CBlockIndex::ToString().
Referenced by CChainState::LoadBlockIndex().
◆ operator=()
|
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 | ||
) |
Definition at line 257 of file txdb.cpp.
References cs, DB_TXINDEX, unordered_limitedmap< K, V, Hash >::insert_or_update(), LOCK, mapHasTxIndexCache, and CDBWrapper::Read().
◆ UpdateAddressUnspentIndex()
bool CBlockTreeDB::UpdateAddressUnspentIndex | ( | const std::vector< std::pair< CAddressUnspentKey, CAddressUnspentValue > > & | vect | ) |
Definition at line 292 of file txdb.cpp.
References DB_ADDRESSUNSPENTINDEX, CDBBatch::Erase(), CDBBatch::Write(), and CDBWrapper::WriteBatch().
◆ UpdateSpentIndex()
bool CBlockTreeDB::UpdateSpentIndex | ( | const std::vector< std::pair< CSpentIndexKey, CSpentIndexValue > > & | vect | ) |
Definition at line 280 of file txdb.cpp.
References DB_SPENTINDEX, CDBBatch::Erase(), CDBBatch::Write(), and CDBWrapper::WriteBatch().
◆ 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 | ||
) |
Definition at line 231 of file txdb.cpp.
References DB_BLOCK_FILES, DB_BLOCK_INDEX, DB_LAST_BLOCK, CDBBatch::Write(), and CDBWrapper::WriteBatch().
◆ 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 | ) |
Definition at line 264 of file txdb.cpp.
References cs, DB_TXINDEX, unordered_limitedmap< K, V, Hash >::insert_or_update(), LOCK, mapHasTxIndexCache, CDBBatch::Write(), and CDBWrapper::WriteBatch().
Member Data Documentation
◆ cs
|
private |
Definition at line 117 of file txdb.h.
Referenced by HasTxIndex(), ReadTxIndex(), and WriteTxIndex().
◆ 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: