Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Private Member Functions | List of all members
CBlockTreeDB Class Reference

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

#include <txdb.h>

Inheritance diagram for CBlockTreeDB:
[legend]
Collaboration diagram for CBlockTreeDB:
[legend]

Public Member Functions

 CBlockTreeDB (size_t nCacheSize, bool fMemory=false, bool fWipe=false)
 
bool WriteBatchSync (const std::vector< std::pair< int, const CBlockFileInfo * > > &fileInfo, int nLastFile, const std::vector< const CBlockIndex * > &blockinfo)
 
bool ReadBlockFileInfo (int nFile, CBlockFileInfo &fileinfo)
 
bool ReadLastBlockFile (int &nFile)
 
bool WriteReindexing (bool fReindex)
 
bool ReadReindexing (bool &fReindex)
 
bool ReadTxIndex (const uint256 &txid, CDiskTxPos &pos)
 
bool WriteTxIndex (const std::vector< std::pair< uint256, CDiskTxPos > > &list)
 
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)
 
bool WriteHeightIndex (const CHeightTxIndexKey &heightIndex, const std::vector< uint256 > &hash)
 
int ReadHeightIndex (int low, int high, int minconf, std::vector< std::vector< uint256 >> &blocksOfHashes, std::set< dev::h160 > const &addresses)
 Iterates through blocks by height, starting from low. More...
 
bool EraseHeightIndex (const unsigned int &height)
 
bool WipeHeightIndex ()
 
- 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 , typename V >
bool Read (const K &key, 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
 
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...
 

Private Member Functions

 CBlockTreeDB (const CBlockTreeDB &)
 
void operator= (const CBlockTreeDB &)
 

Detailed Description

Access to the block database (blocks/index/)

Definition at line 116 of file txdb.h.

Constructor & Destructor Documentation

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

Definition at line 154 of file txdb.cpp.

CBlockTreeDB::CBlockTreeDB ( const CBlockTreeDB )
private

Member Function Documentation

bool CBlockTreeDB::EraseHeightIndex ( const unsigned int &  height)

Definition at line 328 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CBlockTreeDB::LoadBlockIndexGuts ( const Consensus::Params consensusParams,
std::function< CBlockIndex *(const uint256 &)>  insertBlockIndex 
)

Definition at line 370 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CBlockTreeDB::operator= ( const CBlockTreeDB )
private
bool CBlockTreeDB::ReadBlockFileInfo ( int  nFile,
CBlockFileInfo fileinfo 
)

Definition at line 157 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 258 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int CBlockTreeDB::ReadHeightIndex ( int  low,
int  high,
int  minconf,
std::vector< std::vector< uint256 >> &  blocksOfHashes,
std::set< dev::h160 > const &  addresses 
)

Iterates through blocks by height, starting from low.

Parameters
lowstart iterating from this block height
highend iterating at this block height (ignored if <= 0)
minconfstop iterating of the block height does not have enough confirmations (ignored if <= 0)
blocksOfHashestransaction hashes in blocks iterated are collected into this vector.
addressesfilter out a block unless it matches one of the addresses in this set.
Returns
the height of the latest block iterated. 0 if no block is iterated.

Definition at line 273 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CBlockTreeDB::ReadLastBlockFile ( int &  nFile)

Definition at line 173 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CBlockTreeDB::ReadReindexing ( bool &  fReindex)

Definition at line 168 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 243 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CBlockTreeDB::WipeHeightIndex ( )

Definition at line 349 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 254 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CBlockTreeDB::WriteHeightIndex ( const CHeightTxIndexKey heightIndex,
const std::vector< uint256 > &  hash 
)

Definition at line 267 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CBlockTreeDB::WriteReindexing ( bool  fReindex)

Definition at line 161 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 247 of file txdb.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: