Dash Core  0.12.2.1
P2P Digital Currency
CCoinsViewDB Class Reference

#include <txdb.h>

+ Inheritance diagram for CCoinsViewDB:

Public Member Functions

 CCoinsViewDB (size_t nCacheSize, bool fMemory=false, bool fWipe=false)
 
bool GetCoins (const uint256 &txid, CCoins &coins) const
 Retrieve the CCoins (unspent transaction outputs) for a given txid. More...
 
bool HaveCoins (const uint256 &txid) const
 
uint256 GetBestBlock () const
 Retrieve the block hash whose state this CCoinsView currently represents. More...
 
bool BatchWrite (CCoinsMap &mapCoins, const uint256 &hashBlock)
 
bool GetStats (CCoinsStats &stats) const
 Calculate statistics about the unspent transaction output set. More...
 
- Public Member Functions inherited from CCoinsView
virtual ~CCoinsView ()
 As we use CCoinsViews polymorphically, have a virtual destructor. More...
 

Protected Attributes

CDBWrapper db
 

Detailed Description

CCoinsView backed by the coin database (chainstate/)

Definition at line 39 of file txdb.h.

Constructor & Destructor Documentation

◆ CCoinsViewDB()

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

Definition at line 36 of file txdb.cpp.

Member Function Documentation

◆ BatchWrite()

bool CCoinsViewDB::BatchWrite ( CCoinsMap mapCoins,
const uint256 hashBlock 
)
virtual

Do a bulk modification (multiple CCoins changes + BestBlock change). The passed mapCoins can be modified.

Reimplemented from CCoinsView.

Definition at line 55 of file txdb.cpp.

◆ GetBestBlock()

uint256 CCoinsViewDB::GetBestBlock ( ) const
virtual

Retrieve the block hash whose state this CCoinsView currently represents.

Reimplemented from CCoinsView.

Definition at line 48 of file txdb.cpp.

Referenced by GetStats().

◆ GetCoins()

bool CCoinsViewDB::GetCoins ( const uint256 txid,
CCoins coins 
) const
virtual

Retrieve the CCoins (unspent transaction outputs) for a given txid.

Reimplemented from CCoinsView.

Definition at line 40 of file txdb.cpp.

◆ GetStats()

bool CCoinsViewDB::GetStats ( CCoinsStats stats) const
virtual

Calculate statistics about the unspent transaction output set.

Reimplemented from CCoinsView.

Definition at line 101 of file txdb.cpp.

◆ HaveCoins()

bool CCoinsViewDB::HaveCoins ( const uint256 txid) const
virtual

Just check whether we have data for a given txid. This may (but cannot always) return true for fully spent transactions

Reimplemented from CCoinsView.

Definition at line 44 of file txdb.cpp.

Member Data Documentation

◆ db

CDBWrapper CCoinsViewDB::db
protected

Definition at line 42 of file txdb.h.

Referenced by BatchWrite(), GetBestBlock(), GetCoins(), GetStats(), and HaveCoins().


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