Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

CCoinsView Class Reference

Abstract view on the open txout dataset. More...

#include <coins.h>

+ Inheritance diagram for CCoinsView:

Public Member Functions

virtual bool GetCoin (const COutPoint &outpoint, Coin &coin) const
 Retrieve the Coin (unspent transaction output) for a given outpoint. More...
 
virtual bool HaveCoin (const COutPoint &outpoint) const
 Just check whether a given outpoint is unspent. More...
 
virtual uint256 GetBestBlock () const
 Retrieve the block hash whose state this CCoinsView currently represents. More...
 
virtual std::vector< uint256GetHeadBlocks () const
 Retrieve the range of blocks that may have been only partially written. More...
 
virtual bool BatchWrite (CCoinsMap &mapCoins, const uint256 &hashBlock)
 Do a bulk modification (multiple Coin changes + BestBlock change). More...
 
virtual CCoinsViewCursorCursor () const
 Get a cursor to iterate over the whole state. More...
 
virtual ~CCoinsView ()
 As we use CCoinsViews polymorphically, have a virtual destructor. More...
 
virtual size_t EstimateSize () const
 Estimate database size (0 if not implemented) More...
 

Detailed Description

Abstract view on the open txout dataset.

Definition at line 145 of file coins.h.

Constructor & Destructor Documentation

◆ ~CCoinsView()

virtual CCoinsView::~CCoinsView ( )
inlinevirtual

As we use CCoinsViews polymorphically, have a virtual destructor.

Definition at line 174 of file coins.h.

Member Function Documentation

◆ BatchWrite()

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

Do a bulk modification (multiple Coin changes + BestBlock change).

The passed mapCoins can be modified.

Reimplemented in CCoinsViewCache, CCoinsViewBacked, and CCoinsViewDB.

Definition at line 13 of file coins.cpp.

Referenced by CCoinsViewBacked::BatchWrite(), and CCoinsViewCache::Flush().

◆ Cursor()

CCoinsViewCursor * CCoinsView::Cursor ( ) const
virtual

Get a cursor to iterate over the whole state.

Reimplemented in CCoinsViewCache, CCoinsViewBacked, and CCoinsViewDB.

Definition at line 14 of file coins.cpp.

Referenced by CCoinsViewBacked::Cursor(), and GetUTXOStats().

◆ EstimateSize()

virtual size_t CCoinsView::EstimateSize ( ) const
inlinevirtual

Estimate database size (0 if not implemented)

Reimplemented in CCoinsViewBacked, and CCoinsViewDB.

Definition at line 177 of file coins.h.

Referenced by CCoinsViewBacked::EstimateSize(), and GetUTXOStats().

◆ GetBestBlock()

uint256 CCoinsView::GetBestBlock ( ) const
virtual

Retrieve the block hash whose state this CCoinsView currently represents.

Reimplemented in CCoinsViewCache, CCoinsViewBacked, and CCoinsViewDB.

Definition at line 11 of file coins.cpp.

Referenced by CCoinsViewBacked::GetBestBlock(), and CCoinsViewCache::GetBestBlock().

◆ GetCoin()

bool CCoinsView::GetCoin ( const COutPoint outpoint,
Coin coin 
) const
virtual

Retrieve the Coin (unspent transaction output) for a given outpoint.

Returns true only when an unspent coin was found, which is returned in coin. When false is returned, coin's value is unspecified.

Reimplemented in CCoinsViewMemPool, CCoinsViewCache, CCoinsViewErrorCatcher, CCoinsViewBacked, and CCoinsViewDB.

Definition at line 10 of file coins.cpp.

Referenced by CCoinsViewCache::FetchCoin(), CCoinsViewBacked::GetCoin(), CCoinsViewMemPool::GetCoin(), and HaveCoin().

◆ GetHeadBlocks()

std::vector< uint256 > CCoinsView::GetHeadBlocks ( ) const
virtual

Retrieve the range of blocks that may have been only partially written.

If the database is in a consistent state, the result is the empty vector. Otherwise, a two-element vector is returned consisting of the new and the old block hash, in that order.

Reimplemented in CCoinsViewBacked, and CCoinsViewDB.

Definition at line 12 of file coins.cpp.

Referenced by CCoinsViewBacked::GetHeadBlocks(), and CChainState::ReplayBlocks().

◆ HaveCoin()

bool CCoinsView::HaveCoin ( const COutPoint outpoint) const
virtual

Just check whether a given outpoint is unspent.

Reimplemented in CCoinsViewCache, CCoinsViewBacked, and CCoinsViewDB.

Definition at line 16 of file coins.cpp.

References GetCoin().

Referenced by CCoinsViewBacked::HaveCoin().


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