PIVX Core  5.6.99
P2P Digital Currency
Public Member Functions | List of all members
CCoinsView Class Reference

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

#include <coins.h>

Inheritance diagram for CCoinsView:
[legend]

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 we have data for a given outpoint. 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, const uint256 &hashSaplingAnchor, CAnchorsSaplingMap &mapSaplingAnchors, CNullifiersMap &mapSaplingNullifiers)
 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...
 
virtual bool GetSaplingAnchorAt (const uint256 &rt, SaplingMerkleTree &tree) const
 Retrieve the tree (Sapling) at a particular anchored root in the chain. More...
 
virtual bool GetNullifier (const uint256 &nullifier) const
 Determine whether a nullifier is spent or not. More...
 
virtual uint256 GetBestAnchor () const
 Get the current "tip" or the latest anchored tree root in the chain. More...
 

Detailed Description

Abstract view on the open txout dataset.

Definition at line 200 of file coins.h.

Constructor & Destructor Documentation

◆ ~CCoinsView()

virtual CCoinsView::~CCoinsView ( )
inlinevirtual

As we use CCoinsViews polymorphically, have a virtual destructor.

Definition at line 231 of file coins.h.

Member Function Documentation

◆ BatchWrite()

bool CCoinsView::BatchWrite ( CCoinsMap mapCoins,
const uint256 hashBlock,
const uint256 hashSaplingAnchor,
CAnchorsSaplingMap mapSaplingAnchors,
CNullifiersMap mapSaplingNullifiers 
)
virtual

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

The passed mapCoins can be modified.

Reimplemented in CCoinsViewDB, CCoinsViewCache, and CCoinsViewBacked.

Definition at line 22 of file coins.cpp.

Here is the caller graph for this function:

◆ Cursor()

CCoinsViewCursor * CCoinsView::Cursor ( ) const
virtual

Get a cursor to iterate over the whole state.

Reimplemented in CCoinsViewDB, and CCoinsViewBacked.

Definition at line 20 of file coins.cpp.

Here is the caller graph for this function:

◆ EstimateSize()

virtual size_t CCoinsView::EstimateSize ( ) const
inlinevirtual

Estimate database size (0 if not implemented)

Reimplemented in CCoinsViewDB, and CCoinsViewBacked.

Definition at line 234 of file coins.h.

Here is the caller graph for this function:

◆ GetBestAnchor()

uint256 CCoinsView::GetBestAnchor ( ) const
virtual

Get the current "tip" or the latest anchored tree root in the chain.

Reimplemented in CCoinsViewDB, CCoinsViewCache, and CCoinsViewBacked.

Definition at line 31 of file coins.cpp.

Here is the caller graph for this function:

◆ GetBestBlock()

uint256 CCoinsView::GetBestBlock ( ) const
virtual

Retrieve the block hash whose state this CCoinsView currently represents.

Reimplemented in CCoinsViewDB, CCoinsViewCache, and CCoinsViewBacked.

Definition at line 18 of file coins.cpp.

Here is the caller graph for this function:

◆ GetCoin()

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

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

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

Definition at line 16 of file coins.cpp.

Here is the caller graph for this function:

◆ 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 CCoinsViewDB, and CCoinsViewBacked.

Definition at line 19 of file coins.cpp.

Here is the caller graph for this function:

◆ GetNullifier()

bool CCoinsView::GetNullifier ( const uint256 nullifier) const
virtual

Determine whether a nullifier is spent or not.

Reimplemented in CCoinsViewCache, CCoinsViewBacked, CCoinsViewMemPool, and CCoinsViewDB.

Definition at line 30 of file coins.cpp.

Here is the caller graph for this function:

◆ GetSaplingAnchorAt()

bool CCoinsView::GetSaplingAnchorAt ( const uint256 rt,
SaplingMerkleTree tree 
) const
virtual

Retrieve the tree (Sapling) at a particular anchored root in the chain.

Reimplemented in CCoinsViewDB, CCoinsViewCache, and CCoinsViewBacked.

Definition at line 29 of file coins.cpp.

Here is the caller graph for this function:

◆ HaveCoin()

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

Just check whether we have data for a given outpoint.

This may (but cannot always) return true for spent outputs.

Reimplemented in CCoinsViewDB, CCoinsViewCache, CCoinsViewBacked, and CCoinsViewMemPool.

Definition at line 17 of file coins.cpp.

Here is the caller graph for this function:

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